Skip to content

qemu-option, keyval, vl: switch -object/-M/-accel to keyval parsing

Paolo Bonzini qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest28 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/28qemu-option: simplify search for end of keyutil/qemu-option.c+13 -220 replies
2/28qemu-option: pass QemuOptsList to opts_accepts_anyutil/qemu-option.c+13 -100 replies
3/28qemu-option: clean up id vs. list->merge_listsutil/qemu-option.c+14 -130 replies
4/28qemu-option: move help handling to get_opt_name_valueutil/qemu-option.c+23 -150 replies
5/28qemu-option: warn for short-form boolean optionsdocs/system/deprecated.rst tests/test-qemu-opts.c util/qemu-option.c+25 -120 replies
6/28keyval: accept escaped commas in implied optioninclude/qemu/help_option.h tests/test-keyval.c util/keyval.c+91 -830 replies
7/28keyval: simplify keyval_parse_oneutil/keyval.c+10 -170 replies
8/28tests: convert check-qom-proplist to keyvaltests/check-qom-proplist.c+38 -200 replies
9/28keyval: introduce keyval_parse_intoinclude/qemu/option.h util/keyval.c+34 -70 replies
10/28hmp: replace "O" parser with keyvalhmp-commands.hx monitor/hmp.c+12 -140 replies
11/28qom: use qemu_printf to print help for user-creatable objectsqom/object_interfaces.c+7 -60 replies
12/28hmp: special case help options for object_addinclude/qom/object_interfaces.h monitor/hmp-cmds.c qom/object_interfaces.c+17 -160 replies
13/28remove -writeconfiginclude/qemu/config-file.h qemu-options.hx softmmu/vl.c +1 more+2 -730 replies
14/28qemu-config: add error propagation to qemu_config_parseblock/blkdebug.c include/qemu/config-file.h softmmu/vl.c +1 more+25 -320 replies
15/28qemu-option: support accept-any QemuOptsList in qemu_opts_absorb_qdictutil/qemu-option.c+2 -10 replies
16/28qemu-config: parse configuration files to a QDictinclude/qemu/config-file.h softmmu/vl.c util/qemu-config.c+68 -330 replies
17/28vl: plumb keyval-based options into -set and -readconfiginclude/block/qdict.h include/qapi/qmp/qdict.h include/qemu/option.h +3 more+182 -230 replies
18/28qom: do not modify QDict argument in user_creatable_add_dictinclude/qom/object_interfaces.h qom/object_interfaces.c+8 -50 replies
19/28qemu-io: use keyval for -object parsingqemu-io.c+13 -290 replies
20/28qemu-nbd: use keyval for -object parsingqemu-nbd.c+13 -290 replies
21/28qemu-img: use keyval for -object parsingqemu-img.c+52 -2060 replies
22/28qemu: use keyval for -object parsinginclude/qom/object_interfaces.h qom/object_interfaces.c softmmu/vl.c+48 -1670 replies
23/28storage-daemon: do not register the "object" group with QemuOptsstorage-daemon/qemu-storage-daemon.c+0 -100 replies
24/28qom: export more functions for use with non-UserCreatable objectsinclude/qom/object.h qom/object_interfaces.c+57 -150 replies
25/28vl: rename local variable in configure_acceleratorssoftmmu/vl.c+9 -90 replies
26/28vl: switch -M parsing to keyvalsoftmmu/vl.c+132 -1640 replies
27/28qemu-option: remove now-dead codeinclude/qemu/option.h tests/test-qemu-opts.c util/qemu-option.c+10 -790 replies
28/28vl: switch -accel parsing to keyvalaccel/accel.c include/sysemu/accel.h softmmu/vl.c+67 -740 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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

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(-)
Signature · 1 line
2.26.2