Skip to contentSkip to conversation

system: improve -mon deprecation warning

PATCH Superseded Daniel P. Berrangé 3 participants 5 messages Aug 24 – Aug 27

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 system: improve -mon deprecation warning

Expand the text a bit to make the new syntax more explicit and point users to the man page for further info.

---
 system/vl.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
system/vl.c +5 -2
index 061cbdf860..d5b5392569 100644
@@ -3239,8 +3239,11 @@ void qemu_init(int argc, char **argv)
                 default_monitor = 0;
                 break;
             case QEMU_OPTION_mon:
-                warn_report_once("'-mon' is deprecated, use '-object' with "
-                                 "'monitor-hmp' or 'monitor-qmp' types instead");
+                warn_report_once("'-mon' is deprecated. Switch to either "
+                                 "'-object monitor-hmp,id=ID,chardev=CHR-ID' "
+                                 "or '-object monitor-qmp,id=qmpNN,chardev=CHR-ID' "
+                                 "instead. See '-object' docs in 'qemu(1)' for further "
+                                 "configuration guidance.");
                 if (!qemu_opts_parse_noisily(qemu_find_opts("mon"), optarg,
                                              true)) {
                     exit(1);
Signature · 1 line
2.55.0
#1 lore raw
Quoted 15 lines · Daniel P. Berrangé

Expand the text a bit to make the new syntax more explicit and point users to the man page for further info.

---
 system/vl.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
system/vl.c +0 -0
index 061cbdf860..d5b5392569 100644

system/vl.c void qemu_init(int argc, char **argv) · line 3244

Quoted 8 lines
system/vl.c +3 -2
@@ -3239,8 +3239,11 @@ void qemu_init(int argc, char **argv)
                 default_monitor = 0;
                 break;
             case QEMU_OPTION_mon:
-                warn_report_once("'-mon' is deprecated, use '-object' with "
-                                 "'monitor-hmp' or 'monitor-qmp' types instead");
+                warn_report_once("'-mon' is deprecated. Switch to either "
+                                 "'-object monitor-hmp,id=ID,chardev=CHR-ID' "
+                                 "or '-object monitor-qmp,id=qmpNN,chardev=CHR-ID' "

why the difference in id=ID vs id=qmpNN ?

system/vl.c void qemu_init(int argc, char **argv) · line 3246

Quoted 2 lines
system/vl.c +2 -0
+                                 "instead. See '-object' docs in 'qemu(1)' for further "
+                                 "configuration guidance.");

Personally I think of the HTML docs as our primary documentation and the manpages as a kind of "not very well maintained extracted subset", so I wouldn't want to point people at qemu(1).

thanks
-- PMM

#3 lore raw
In reply to Daniel P. Berrangé
Quoted 14 lines · Daniel P. Berrangé

Expand the text a bit to make the new syntax more explicit and point users to the man page for further info.

---
  system/vl.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
system/vl.c +0 -0
index 061cbdf860..d5b5392569 100644

system/vl.c void qemu_init(int argc, char **argv) · line 3246

Quoted 10 lines
system/vl.c +5 -2
@@ -3239,8 +3239,11 @@ void qemu_init(int argc, char **argv)
                  default_monitor = 0;
                  break;
              case QEMU_OPTION_mon:
-                warn_report_once("'-mon' is deprecated, use '-object' with "
-                                 "'monitor-hmp' or 'monitor-qmp' types instead");
+                warn_report_once("'-mon' is deprecated. Switch to either "
+                                 "'-object monitor-hmp,id=ID,chardev=CHR-ID' "
+                                 "or '-object monitor-qmp,id=qmpNN,chardev=CHR-ID' "
+                                 "instead. See '-object' docs in 'qemu(1)' for further "
+                                 "configuration guidance.");

Looking at commit 58b70f21ba6 ("docs: mark '-mon' as deprecated in favour of -object") I'm not sure this is a good idea to document '-object monitor-qmp' at all on CLI help. CLI users looking at help output are likely users of '-mon' for HMP. My 2 cents.

Quoted 3 lines
system/vl.c +0 -0
                  if (!qemu_opts_parse_noisily(qemu_find_opts("mon"), optarg,
                                               true)) {
                      exit(1);
#4 lore raw
Quoted 22 lines · Philippe Mathieu-Daudé
Quoted 21 lines · Daniel P. Berrangé

Expand the text a bit to make the new syntax more explicit and point users to the man page for further info.

---
  system/vl.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
system/vl.c +2 -2
index 061cbdf860..d5b5392569 100644
@@ -3239,8 +3239,11 @@ void qemu_init(int argc, char **argv)
                  default_monitor = 0;
                  break;
              case QEMU_OPTION_mon:
-                warn_report_once("'-mon' is deprecated, use '-object' with "
-                                 "'monitor-hmp' or 'monitor-qmp' types instead");
+                warn_report_once("'-mon' is deprecated. Switch to either "
+                                 "'-object monitor-hmp,id=ID,chardev=CHR-ID' "
Quoted 8 lines

system/vl.c void qemu_init(int argc, char **argv) · line 3246

Quoted 3 lines
system/vl.c +3 -0
+                                 "or '-object monitor-qmp,id=qmpNN,chardev=CHR-ID' "
+                                 "instead. See '-object' docs in 'qemu(1)' for further "
+                                 "configuration guidance.");

Looking at commit 58b70f21ba6 ("docs: mark '-mon' as deprecated in favour of -object") I'm not sure this is a good idea to document '-object monitor-qmp' at all on CLI help. CLI users looking at help output are likely users of '-mon' for HMP. My 2 cents.

The warnings here get reported in machine use of QEMU too, not just interactive usage. In libvirt they'll end up in /var/log/libvirt/qemu/$GUEST.log.

I expect most end user non-managed launches of QEMU are using the higher level -monitor for HMP, with -mon more likely machine usage.

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|
#2 lore raw
In reply to Peter Maydell
Quoted 11 lines · Peter Maydell
Quoted 10 lines · Daniel P. Berrangé

Expand the text a bit to make the new syntax more explicit and point users to the man page for further info.

---
 system/vl.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Quoted 15 lines

system/vl.c void qemu_init(int argc, char **argv) · line 3244

Quoted 13 lines
system/vl.c +3 -2
index 061cbdf860..d5b5392569 100644
@@ -3239,8 +3239,11 @@ void qemu_init(int argc, char **argv)
                 default_monitor = 0;
                 break;
             case QEMU_OPTION_mon:
-                warn_report_once("'-mon' is deprecated, use '-object' with "
-                                 "'monitor-hmp' or 'monitor-qmp' types instead");
+                warn_report_once("'-mon' is deprecated. Switch to either "
+                                 "'-object monitor-hmp,id=ID,chardev=CHR-ID' "
+                                 "or '-object monitor-qmp,id=qmpNN,chardev=CHR-ID' "

why the difference in id=ID vs id=qmpNN ?

A mistake :-)

Quoted 6 lines

system/vl.c void qemu_init(int argc, char **argv) · line 3246

Quoted 2 lines
system/vl.c +2 -0
+                                 "instead. See '-object' docs in 'qemu(1)' for further "
+                                 "configuration guidance.");

Personally I think of the HTML docs as our primary documentation and the manpages as a kind of "not very well maintained extracted subset", so I wouldn't want to point people at qemu(1).

The manpages have full coverage of the CLI args with identical content as the online manual.

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|