mbox series

[00/28] qemu-option, keyval, vl: switch -object/-M/-accel to keyval parsing

Message ID 20201202090305.4129317-1-pbonzini@redhat.com (mailing list archive)
Headers show
Series qemu-option, keyval, vl: switch -object/-M/-accel to keyval parsing | expand

Message

Paolo Bonzini Dec. 2, 2020, 9:02 a.m. UTC
This series switches -object, -M and -accel from QemuOpts to keyval.
Monitor commands device_add and netdev_add are also switched to keyval,
though -device and -netdev for now are not.

Along the way, the syntax of keyval and QemuOpts becomes more consistent
and support for keyval-based options is added to -readconfig.  -writeconfig
instead is removed (see patch 13 for rationale).

The reason to do this is:

- to make qemu-io, qemu-nbd, qemu-img and QEMU's parsing of -object
  consistent with qemu-storage-daemon's

- to allow using compound properties in -object, -M and -accel

Patch 1-5: make QemuOpts parsing a bit more restrictive, warning for
short-form boolean options and removing weird ways to request help
such as "help=foo" or "no?".

Patch 6-12: let keyval accept escaped commas in implied options,
switch comma-separated syntax for HMP from QemuOpts to keyval,
add help support to object_add

Patch 13-18: plumbing for reading keyval-based options in vl.c,
including -set and -readconfig.

Patch 19-23: switch -object to keyval everywhere

Patch 24-28: switch -M and -accel to keyval

Paolo Bonzini (28):
  qemu-option: simplify search for end of key
  qemu-option: pass QemuOptsList to opts_accepts_any
  qemu-option: clean up id vs. list->merge_lists
  qemu-option: move help handling to get_opt_name_value
  qemu-option: warn for short-form boolean options
  keyval: accept escaped commas in implied option
  keyval: simplify keyval_parse_one
  tests: convert check-qom-proplist to keyval
  keyval: introduce keyval_parse_into
  hmp: replace "O" parser with keyval
  qom: use qemu_printf to print help for user-creatable objects
  hmp: special case help options for object_add
  remove -writeconfig
  qemu-config: add error propagation to qemu_config_parse
  qemu-option: support accept-any QemuOptsList in qemu_opts_absorb_qdict
  qemu-config: parse configuration files to a QDict
  vl: plumb keyval-based options into -set and -readconfig
  qom: do not modify QDict argument in user_creatable_add_dict
  qemu-io: use keyval for -object parsing
  qemu-nbd: use keyval for -object parsing
  qemu-img: use keyval for -object parsing
  qemu: use keyval for -object parsing
  storage-daemon: do not register the "object" group with QemuOpts
  qom: export more functions for use with non-UserCreatable objects
  vl: rename local variable in configure_accelerators
  vl: switch -M parsing to keyval
  qemu-option: remove now-dead code
  vl: switch -accel parsing to keyval

 accel/accel.c                        |   6 +
 block/blkdebug.c                     |   3 +-
 docs/system/deprecated.rst           |   6 +
 hmp-commands.hx                      |   6 +-
 include/block/qdict.h                |   2 -
 include/qapi/qmp/qdict.h             |   3 +
 include/qemu/config-file.h           |   9 +-
 include/qemu/help_option.h           |  11 -
 include/qemu/option.h                |   6 +-
 include/qom/object.h                 |  21 +
 include/qom/object_interfaces.h      |  68 +--
 include/sysemu/accel.h               |   1 +
 monitor/hmp-cmds.c                   |  22 +-
 monitor/hmp.c                        |  20 +-
 qemu-img.c                           | 258 ++--------
 qemu-io.c                            |  42 +-
 qemu-nbd.c                           |  42 +-
 qemu-options.hx                      |  13 +-
 qom/object_interfaces.c              | 152 ++----
 softmmu/vl.c                         | 687 ++++++++++++++-------------
 storage-daemon/qemu-storage-daemon.c |  10 -
 tests/check-qom-proplist.c           |  58 ++-
 tests/test-keyval.c                  |  53 ++-
 tests/test-qemu-opts.c               |  37 +-
 util/keyval.c                        | 230 +++++----
 util/qemu-config.c                   | 141 +++---
 util/qemu-option.c                   | 184 ++++---
 27 files changed, 946 insertions(+), 1145 deletions(-)

Comments

Paolo Bonzini Jan. 17, 2021, 4:48 p.m. UTC | #1
On 02/12/20 10:02, Paolo Bonzini wrote:
> This series switches -object, -M and -accel from QemuOpts to keyval.
> Monitor commands device_add and netdev_add are also switched to keyval,
> though -device and -netdev for now are not.
> 
> Along the way, the syntax of keyval and QemuOpts becomes more consistent
> and support for keyval-based options is added to -readconfig.  -writeconfig
> instead is removed (see patch 13 for rationale).
> 
> The reason to do this is:
> 
> - to make qemu-io, qemu-nbd, qemu-img and QEMU's parsing of -object
>    consistent with qemu-storage-daemon's
> 
> - to allow using compound properties in -object, -M and -accel
> 
> Patch 1-5: make QemuOpts parsing a bit more restrictive, warning for
> short-form boolean options and removing weird ways to request help
> such as "help=foo" or "no?".
> 
> Patch 6-12: let keyval accept escaped commas in implied options,
> switch comma-separated syntax for HMP from QemuOpts to keyval,
> add help support to object_add
> 
> Patch 13-18: plumbing for reading keyval-based options in vl.c,
> including -set and -readconfig.
> 
> Patch 19-23: switch -object to keyval everywhere
> 
> Patch 24-28: switch -M and -accel to keyval
> 
> Paolo Bonzini (28):
>    qemu-option: simplify search for end of key
>    qemu-option: pass QemuOptsList to opts_accepts_any
>    qemu-option: clean up id vs. list->merge_lists
>    qemu-option: move help handling to get_opt_name_value
>    qemu-option: warn for short-form boolean options
>    keyval: accept escaped commas in implied option
>    keyval: simplify keyval_parse_one
>    tests: convert check-qom-proplist to keyval
>    keyval: introduce keyval_parse_into
>    hmp: replace "O" parser with keyval
>    qom: use qemu_printf to print help for user-creatable objects
>    hmp: special case help options for object_add
>    remove -writeconfig
>    qemu-config: add error propagation to qemu_config_parse
>    qemu-option: support accept-any QemuOptsList in qemu_opts_absorb_qdict
>    qemu-config: parse configuration files to a QDict
>    vl: plumb keyval-based options into -set and -readconfig
>    qom: do not modify QDict argument in user_creatable_add_dict
>    qemu-io: use keyval for -object parsing
>    qemu-nbd: use keyval for -object parsing
>    qemu-img: use keyval for -object parsing
>    qemu: use keyval for -object parsing
>    storage-daemon: do not register the "object" group with QemuOpts
>    qom: export more functions for use with non-UserCreatable objects
>    vl: rename local variable in configure_accelerators
>    vl: switch -M parsing to keyval
>    qemu-option: remove now-dead code
>    vl: switch -accel parsing to keyval
> 
>   accel/accel.c                        |   6 +
>   block/blkdebug.c                     |   3 +-
>   docs/system/deprecated.rst           |   6 +
>   hmp-commands.hx                      |   6 +-
>   include/block/qdict.h                |   2 -
>   include/qapi/qmp/qdict.h             |   3 +
>   include/qemu/config-file.h           |   9 +-
>   include/qemu/help_option.h           |  11 -
>   include/qemu/option.h                |   6 +-
>   include/qom/object.h                 |  21 +
>   include/qom/object_interfaces.h      |  68 +--
>   include/sysemu/accel.h               |   1 +
>   monitor/hmp-cmds.c                   |  22 +-
>   monitor/hmp.c                        |  20 +-
>   qemu-img.c                           | 258 ++--------
>   qemu-io.c                            |  42 +-
>   qemu-nbd.c                           |  42 +-
>   qemu-options.hx                      |  13 +-
>   qom/object_interfaces.c              | 152 ++----
>   softmmu/vl.c                         | 687 ++++++++++++++-------------
>   storage-daemon/qemu-storage-daemon.c |  10 -
>   tests/check-qom-proplist.c           |  58 ++-
>   tests/test-keyval.c                  |  53 ++-
>   tests/test-qemu-opts.c               |  37 +-
>   util/keyval.c                        | 230 +++++----
>   util/qemu-config.c                   | 141 +++---
>   util/qemu-option.c                   | 184 ++++---
>   27 files changed, 946 insertions(+), 1145 deletions(-)
> 

Ping?  It's been over a month (even if with the Christmas vacation).

Patches 1-2 were already reviewed so I have included them already.  I 
would like at least the next 14 patches to go in as soon as possible. 
(The rest can be routed through maintainer trees or I can post them 
together with the softmmu/vl.c cleanups).

Paolo
Kevin Wolf Jan. 18, 2021, 10:29 a.m. UTC | #2
Am 17.01.2021 um 17:48 hat Paolo Bonzini geschrieben:
> On 02/12/20 10:02, Paolo Bonzini wrote:
> > This series switches -object, -M and -accel from QemuOpts to keyval.
> > Monitor commands device_add and netdev_add are also switched to keyval,
> > though -device and -netdev for now are not.
> > 
> > Along the way, the syntax of keyval and QemuOpts becomes more consistent
> > and support for keyval-based options is added to -readconfig.  -writeconfig
> > instead is removed (see patch 13 for rationale).

> Ping?  It's been over a month (even if with the Christmas vacation).
> 
> Patches 1-2 were already reviewed so I have included them already.  I would
> like at least the next 14 patches to go in as soon as possible. (The rest
> can be routed through maintainer trees or I can post them together with the
> softmmu/vl.c cleanups).

On which commit is this based? It doesn't seem to apply to master (maybe
no surprise), but also not to 5.2.0-rc4, which was the state of master
when this was posted.

Kevin
Paolo Bonzini Jan. 18, 2021, 12:47 p.m. UTC | #3
On 18/01/21 11:29, Kevin Wolf wrote:
> Am 17.01.2021 um 17:48 hat Paolo Bonzini geschrieben:
>> On 02/12/20 10:02, Paolo Bonzini wrote:
>>> This series switches -object, -M and -accel from QemuOpts to keyval.
>>> Monitor commands device_add and netdev_add are also switched to keyval,
>>> though -device and -netdev for now are not.
>>>
>>> Along the way, the syntax of keyval and QemuOpts becomes more consistent
>>> and support for keyval-based options is added to -readconfig.  -writeconfig
>>> instead is removed (see patch 13 for rationale).
> 
>> Ping?  It's been over a month (even if with the Christmas vacation).
>>
>> Patches 1-2 were already reviewed so I have included them already.  I would
>> like at least the next 14 patches to go in as soon as possible. (The rest
>> can be routed through maintainer trees or I can post them together with the
>> softmmu/vl.c cleanups).
> 
> On which commit is this based? It doesn't seem to apply to master (maybe
> no surprise), but also not to 5.2.0-rc4, which was the state of master
> when this was posted.

I'll retest and repost.

Paolo