Skip to content

deprecate short-form boolean options

Paolo Bonzini qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4ivshmem-test: do not use short-form boolean optiontests/qtest/ivshmem-test.c+1 -12 replies
2/4qemu-option: move help handling to get_opt_name_valueutil/qemu-option.c+18 -172 replies
3/4qtest: escape device name in device-introspect-testtests/qtest/device-introspect-test.c+6 -35 replies
4/4qemu-option: warn for short-form boolean optionschardev/char.c docs/system/deprecated.rst include/qemu/option.h +3 more+26 -76 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchThomas HuthMarkus Armbruster
1/4R-b R-b
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH for-5.2 0/4] deprecate short-form boolean options

QemuOpts lets you write boolean options in "short form" where "abc" means "abc=on" and "noabc" means "abc=off". This is confusing, since it is not done for the first key=value pair but only if there is an implied key; it can also be grossly misused, for example "-device e1000,noid" will create a device with id equal to "off".

Unfortunately, this idiom has found wide use with -chardev (think "server,nowait") and to a lesser extent -spice.

Patch 4 in this series deprecates it for all other option groups. The first three patches avoid emitting the warning in tests (which in one case were buggy, see patch 3) or for the "help" option.

Paolo Bonzini (4):
ivshmem-test: do not use short-form boolean option
qemu-option: move help handling to get_opt_name_value
qtest: escape device name in device-introspect-test
qemu-option: warn for short-form boolean options

 chardev/char.c                       |  1 +
 docs/system/deprecated.rst           |  7 ++++
 include/qemu/option.h                |  1 +
 tests/qtest/device-introspect-test.c |  9 +++--
 tests/qtest/ivshmem-test.c           |  2 +-
 tests/test-qemu-opts.c               |  1 +
 ui/spice-core.c                      |  1 +
 util/qemu-option.c                   | 51 ++++++++++++++++------------
 8 files changed, 48 insertions(+), 25 deletions(-)
Signature · 1 line
2.26.2