On Mon, Jul 06, 2026 at 12:56:35PM +0200, Markus Armbruster wrote:
> Daniel P. Berrangé <[email protected]> writes:
> 
> > Add new docs for the `-object monitor-hmp` and `-object monitor-qmp`
> > options, updating `-mon` to state that it is legacy syntax sugar
> > for the new `-object` args.
> >
> > Signed-off-by: Daniel P. Berrangé <[email protected]>
> > ---
> >  qemu-options.hx | 61 ++++++++++++++++++++++++++++++++++++++++++++++---
> >  1 file changed, 58 insertions(+), 3 deletions(-)
> >
> > diff --git a/qemu-options.hx b/qemu-options.hx
> > index e44b47de68..1aa548c39b 100644
> > --- a/qemu-options.hx
> > +++ b/qemu-options.hx
> > @@ -4955,6 +4955,11 @@ SRST
> >      port). The default device is ``vc`` in graphical mode and ``stdio``
> >      in non graphical mode. Use ``-monitor none`` to disable the default
> >      monitor.
> > +
> > +    The use of ``-monitor dev`` is syntax sugar for creating a character
> 
> For what it's worth, Wikipedia redirects "syntax sugar" to "syntactic
> sugar", and uses only the latter in the article.

Ok will use that

> 
> Could also use "shorthand".  Matter of taste.
> 
> > +    device from ``dev`` and pairing it with ``-object monitor-hmp``.
> > +    Both the character device and monitor object will be given an ID
> > +    ``compat_monitorNNN`` where ``NNN`` is a counter starting from 0.
> >  ERST
> >  DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \
> >      "-qmp dev        like -monitor but opens in 'control' mode\n",
> > @@ -4966,9 +4971,10 @@ 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``.
> > -
> > +    The use of ``-monitor dev`` is syntax sugar for creating a character
> 
> Pasto, you mean ``-qmp dev``.

/face-palm

> 
> > +    device from ``dev`` and pairing it with ``-object monitor-qmp``.
> > +    Both the character device and monitor object will be given an ID
> > +    ``compat_monitorNNN`` where ``NNN`` is a counter starting from 0.
> >  ERST
> >  DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \
> >      "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n",
> > @@ -4997,6 +5003,16 @@ SRST
> >        -mon chardev=mon1,mode=control,pretty=on
> >  
> >      enables the QMP monitor on localhost port 4444 with pretty-printing.
> > +
> > +    The use of ``-mon mode=readline`` is historical syntax sugar
> 
> What does "historical" mean?  The next patch replaces it by
> "deprecated".  Suggest to scratch it here.

ok.


> > @@ -5747,6 +5763,45 @@ SRST
> >      they are specified. Note that the 'id' property must be set. These
> >      objects are placed in the '/objects' path.
> >  
> > +    ``-object monitor-hmp,id=id,chardev=chardev_id,readline=on|off``
> > +        Set up a monitor running the Human Monitor Protocol,
> > +        connected to the chardev ``chardev_id``.
> > +
> > +        The ``id`` parameter is a unique ID that can be used
> > +        to dynamically delete the monitor at runtime. Note
> > +        that monitors created using the historical syntax
> > +        will be allocated IDs following the pattern ``hmpcompatNN``.
> 
> ``compat_monitorNNN``
> 
> > +        Mixing ``-object`` with the historical monitor syntax is
> > +        discouraged.
> 
> Clearer, I think: "with -monitor and -mon".
> 
> The next patch deprecates -mon, and then this could become just "with
> -monitor".

ok

> 
> > +
> > +        The ``readline`` parameter, which defaults to ``on``,
> > +        controls whether the monitor provides line editing.
> > +
> > +    ``-object 
> > monitor-qmp,id=id,chardev=chardev_id,pretty=on|off,close-action=none|delete``
> > +        Set up a monitor running the QEMU Monitor Protocol,
> > +        connected to the chardev ``chardev_id``.
> > +
> > +        The ``id`` parameter is a unique ID that can be used
> > +        to dynamically delete the monitor at runtime. Note
> > +        that monitors created using the historical syntax
> > +        will be allocated IDs following the pattern ``qmpcompatNN``.
> 
> ``compat_monitorNNN``
> 
> > +        Mixing ``-object`` with the historical monitor syntax is
> > +        discouraged.
> 
> "with -qmp, -qmp-pretty, and -mon".
> 
> The next patch deprecates -mon, and then this could become just "with
> -qmp and -qmp-pretty".

ok

> 
> > +
> > +        The ``pretty`` parameter, which defaults to ``off``,
> > +        controls whether the monitor responses are pretty
> > +        printed as multi-line indented JSON, as opposed to
> > +        constrained to a single line without extraneous
> > +        whitespace.
> > +
> > +        The ``close-action`` parameter, which defaults to ``none``,
> > +        controls what happens when the connection to the monitor
> > +        is terminated by the user. If set to ``delete``, then the
> > +        ``monitor-qmp`` object and its associated character
> > +        device are both immediately deleted. This can be useful
> > +        if an extra monitor was hotplugged for a specific task
> 
> Comma after task?

I don't think its needed, but people are horribly inconsistent in
use of , before and in English no matter what.

> 
> > +        and should be unplugged when completed.
> > +
> >      ``-object 
> > memory-backend-file,id=id,size=size,mem-path=dir,share=on|off,discard-data=on|off,merge=on|off,dump=on|off,prealloc=on|off,host-nodes=host-nodes,policy=default|preferred|bind|interleave,align=align,offset=offset,readonly=on|off,rom=on|off|auto``
> >          Creates a memory file backend object, which can be used to back
> >          the guest RAM with huge pages.
> 

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|

Reply via email to