All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Dr. David Alan Gilbert" <dave@treblig.org>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Christian Brauner" <brauner@kernel.org>,
	devel@lists.libvirt.org, "Markus Armbruster" <armbru@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@mailo.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PATCH v4 35/35] docs: mark '-mon' as deprecated in favour of -object
Date: Tue, 23 Jun 2026 10:55:51 +0100	[thread overview]
Message-ID: <20260623095551.2106712-36-berrange@redhat.com> (raw)
In-Reply-To: <20260623095551.2106712-1-berrange@redhat.com>

The high level `-qmp` and `-monitor` options can remain as convenience
wrappers, but the low level `-mon` is completed obsoleted by the new
`-object` support with 'monitor-qmp' and 'monitor-hmp' types.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 docs/about/deprecated.rst               | 10 ++++++++++
 docs/devel/writing-monitor-commands.rst |  4 ++--
 docs/system/arm/xenpvh.rst              |  4 ++--
 docs/system/i386/xen.rst                |  3 ++-
 docs/system/i386/xenpvh.rst             |  4 ++--
 qemu-options.hx                         | 11 ++++++-----
 system/vl.c                             |  2 ++
 7 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 97750f5edc..8370fc5680 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -61,6 +61,16 @@ The ``debug-threads`` option of the ``-name`` argument is now
 ignored. Thread naming is unconditionally enabled for all platforms
 where it is supported.
 
+``-mon`` option (since 11.1)
+''''''''''''''''''''''''''''
+
+The ``-mon`` option was the generic mechanism for creating monitor objects
+if the convenience ``-qmp`` or ``-monitor`` options were not flexible
+enough. The monitor objects have been converted to QOM, so ``-mon mode=readline``
+is replaced by ``-object monitor-hmp`` and ``-mon mode=control`` is replaced
+by ``-object monitor-qmp``. The short convenience options are not deprecated,
+only ``-mon``.
+
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
 
diff --git a/docs/devel/writing-monitor-commands.rst b/docs/devel/writing-monitor-commands.rst
index 930da5cd06..7ae7efe327 100644
--- a/docs/devel/writing-monitor-commands.rst
+++ b/docs/devel/writing-monitor-commands.rst
@@ -52,8 +52,8 @@ shown here.
 First, QEMU should be started like this::
 
  # qemu-system-TARGET [...] \
-     -chardev socket,id=qmp,port=4444,host=localhost,server=on \
-     -mon chardev=qmp,mode=control,pretty=on
+     -chardev socket,id=chrqmp0,port=4444,host=localhost,server=on \
+     -object monitor-qmp,chardev=chrqmp0,pretty=on,id=qmp0
 
 Then, in a different terminal::
 
diff --git a/docs/system/arm/xenpvh.rst b/docs/system/arm/xenpvh.rst
index 430ac2c02e..511af63e3d 100644
--- a/docs/system/arm/xenpvh.rst
+++ b/docs/system/arm/xenpvh.rst
@@ -27,9 +27,9 @@ Sample QEMU xenpvh commands for running and connecting with Xen:
 
     qemu-system-aarch64 -xen-domid 1 \
       -chardev socket,id=libxl-cmd,path=qmp-libxl-1,server=on,wait=off \
-      -mon chardev=libxl-cmd,mode=control \
+      -object monitor-qmp,id=qmp0,chardev=libxl-cmd \
       -chardev socket,id=libxenstat-cmd,path=qmp-libxenstat-1,server=on,wait=off \
-      -mon chardev=libxenstat-cmd,mode=control \
+      -object monitor-qmp,id=qmp1,chardev=libxenstat-cmd \
       -xen-attach -name guest0 -vnc none -display none -nographic \
       -machine xenpvh -m 1301 \
       -chardev socket,id=chrtpm,path=tmp/vtpm2/swtpm-sock \
diff --git a/docs/system/i386/xen.rst b/docs/system/i386/xen.rst
index 46db5f34c1..6ff5cdb1e4 100644
--- a/docs/system/i386/xen.rst
+++ b/docs/system/i386/xen.rst
@@ -79,7 +79,8 @@ of type ``xen-console`` to connect to it. For the Xen console equivalent of
 the handy ``-serial mon:stdio`` option, for example:
 
 .. parsed-literal::
-   -chardev stdio,mux=on,id=char0,signal=off -mon char0 \\
+   -chardev stdio,mux=on,id=char0,signal=off \\
+   -object monitor-hmp,chardev=char0,id=hmp0 \\
    -device xen-console,chardev=char0
 
 The Xen network device is ``xen-net-device``, which becomes the default NIC
diff --git a/docs/system/i386/xenpvh.rst b/docs/system/i386/xenpvh.rst
index 354250f073..904778e3f5 100644
--- a/docs/system/i386/xenpvh.rst
+++ b/docs/system/i386/xenpvh.rst
@@ -33,9 +33,9 @@ case you need to construct one manually:
 
     qemu-system-i386 -xen-domid 3 -no-shutdown        \
       -chardev socket,id=libxl-cmd,path=/var/run/xen/qmp-libxl-3,server=on,wait=off \
-      -mon chardev=libxl-cmd,mode=control             \
+      -object monitor-qmp,id=qmp0,chardev=libxl-cmd   \
       -chardev socket,id=libxenstat-cmd,path=/var/run/xen/qmp-libxenstat-3,server=on,wait=off \
-      -mon chardev=libxenstat-cmd,mode=control        \
+      -object monitor-qmp,id=qmp1,chardev=libxenstat-cmd \
       -nodefaults                                     \
       -no-user-config                                 \
       -xen-attach -name g0                            \
diff --git a/qemu-options.hx b/qemu-options.hx
index 98c74cc9ff..32b0cfba03 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4137,7 +4137,7 @@ The general form of a character device option is:
     ::
 
         -chardev stdio,mux=on,id=char0 \
-        -mon chardev=char0,mode=readline \
+        -object monitor-hmp,id=hmp0,chardev=char0 \
         -serial chardev:char0 \
         -serial chardev:char0
 
@@ -4149,7 +4149,7 @@ The general form of a character device option is:
     ::
 
         -chardev stdio,mux=on,id=char0 \
-        -mon chardev=char0,mode=readline \
+        -object monitor-hmp,id=hmp0,chardev=char0 \
         -parallel chardev:char0 \
         -chardev tcp,...,mux=on,id=char1 \
         -serial chardev:char1 \
@@ -4950,7 +4950,8 @@ SRST
         -qmp tcp:localhost:4444,server=on,wait=off
 
     Not all options are configurable via this syntax; for maximum
-    flexibility use the ``-mon`` option and an accompanying ``-chardev``.
+    flexibility use ``-object monitor-qmp`` and an accompanying
+    ``-chardev``.
 
 ERST
 DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \
@@ -4981,12 +4982,12 @@ SRST
 
     enables the QMP monitor on localhost port 4444 with pretty-printing.
 
-    The use of ``-mon mode=readline`` is historical syntax sugar
+    The use of ``-mon mode=readline`` is deprecated syntax sugar
     for the new ``-object monitor-hmp`` option, each use of which
     creates an object with the ID ``hmpcompatNNN`` where ``NNN`` is
     a counter starting from 0.
 
-    The use of ``-mon mode=control`` is historical syntax sugar
+    The use of ``-mon mode=control`` is deprecated syntax sugar
     for the new ``-object monitor-qmp`` option, each use of which
     creates an object with the ID ``qmpcompatNNN`` where ``NNN`` is
     a counter starting from 0.
diff --git a/system/vl.c b/system/vl.c
index 79ed2be449..a7b6d37452 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -3240,6 +3240,8 @@ 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");
                 if (!qemu_opts_parse_noisily(qemu_find_opts("mon"), optarg,
                                              true)) {
                     exit(1);
-- 
2.54.0



  parent reply	other threads:[~2026-06-23  9:58 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23  9:55 [PATCH v4 00/35] monitor: turn QMP and HMP into QOM objects Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 01/35] qom: replace 'can_be_deleted' with 'prepare_delete' Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 02/35] monitor: replace 'common' with 'parent_obj' in MonitorHMP Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 03/35] monitor: replace 'common' with 'parent_obj' in MonitorQMP Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 04/35] monitor: rename monitor_init* to monitor_new* Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 05/35] monitor: minimal conversion of monitors to QOM Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 06/35] monitor: add 'chardev' property to Monitor base class Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 07/35] monitor: add 'readline' property to HMP Monitor class Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 08/35] monitor: add 'pretty' property to QMP " Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 09/35] monitor: remove 'skip_flush' field Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 10/35] monitor: move monitor_data_(init|destroy) into QOM init/finalize Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 11/35] monitor: use class methods for monitor_vprintf Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 12/35] monitor: use class methods for monitor_qapi_event_emit Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 13/35] monitor: use class methods for monitor_accept_input Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 14/35] monitor: use class method for I/O thread request Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 15/35] monitor: use dynamic cast in monitor_qmp_requests_pop_any_with_lock Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 16/35] util: use dynamic cast in error vreport Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 17/35] monitor: drop unused monitor_cur_is_qmp Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 18/35] monitor: use dynamic cast in QMP commands Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 19/35] monitor: use dynamic cast in monitor_is_hmp_non_interactive Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 20/35] monitor: drop unused monitor_is_qmp method Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 21/35] monitor: eliminate monitor_is_hmp_non_interactive method Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 22/35] monitor: implement "user creatable" interface for adding monitors Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 23/35] monitor: convert from oneshot BH to persistent BH Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 24/35] monitor: reject attempts to delete the current monitor Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 25/35] monitor: protect qemu_chr_fe_accept_input with monitor lock Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 26/35] monitor: implement support for deleting QMP objects Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 27/35] tests/qtest: add tests for dynamic monitor add/remove Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 28/35] tests/functional: add e2e test for dynamic QMP monitor hotplug Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 29/35] tests/functional: add a stress test for monitor hot unplug Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 30/35] qom: add method for getting the "id" of a QOM object Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 31/35] qom: add trace events for user creatable create/delete APIs Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 32/35] monitor: add support for auto-deleting monitors upon close Daniel P. Berrangé
2026-06-23 11:53   ` marcandre.lureau
2026-06-23 11:55     ` Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 33/35] tests: switch from -mon to -object monitor-qmp Daniel P. Berrangé
2026-06-23  9:55 ` [PATCH v4 34/35] qemu-options: document new monitor-hmp and monitor-qmp objects Daniel P. Berrangé
2026-06-23  9:55 ` Daniel P. Berrangé [this message]
2026-06-23 11:03 ` [PATCH v4 00/35] monitor: turn QMP and HMP into QOM objects Peter Krempa
2026-06-23 11:07   ` Peter Krempa
2026-06-23 11:38   ` Daniel P. Berrangé
2026-06-23 11:52     ` Daniel P. Berrangé
2026-06-23 11:54       ` Marc-André Lureau
2026-06-23 12:01         ` Daniel P. Berrangé
2026-06-23 12:18       ` Peter Krempa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260623095551.2106712-36-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=brauner@kernel.org \
    --cc=dave@treblig.org \
    --cc=devel@lists.libvirt.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@mailo.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.