qemu-options: Spring cleanup
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest11 patches 20 repliesIn review
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | qemu-option: Use g_autofree when calling get_opt_name_value()util/ | +11 | 1 reply | |
| 2/11 | tests/unit/test-qemu-opts: Validate help=foo optionstests/ | +27 | 1 reply | |
| 3/11 | qemu-option: Remove short form options supportdocs/ tests/ tests/ +5 more | +73 | 7 replies | |
| 4/11 | qemu-option: Fix 'help' parameter parsinginclude/ tests/ util/ | +63 | 2 replies | |
| 5/11 | qemu-option: Add qemu_opts_parse_listinclude/ tests/ util/ +1 more | +109 | 1 reply | |
| 6/11 | qemu-option: Change qemu_parse_opts() to take the group nameinclude/ system/ tests/ +1 more | +18 | 1 reply | |
| 7/11 | qemu-option: Add qemu_opts_parse_list_noisilyinclude/ util/ | +16 | 2 replies | |
| 8/11 | qemu-option: Use qemu_opts_parse_list_noisily where appropriateblock/ monitor/ net/ +10 more | +26 | 1 reply | |
| 9/11 | qemu-option: Change qemu_opts_parse_noisily() to take the groupblock/ blockdev.c chardev/ +10 more | +52 | 2 replies | |
| 10/11 | qemu-option: Check for NULL list at qemu_opts_parse()util/ | +4 | 1 reply | |
| 11/11 | qemu-option: Remove a few instances of noisily parsingblock/ include/ monitor/ +9 more | +55 | 1 reply |
Reviews trailers per patch
10 of 11 patches have a Reviewed-by or Acked-by.
| Patch | Daniel P. Berrangé | Stefan Hajnoczi | Marc-André Lureau |
|---|---|---|---|
| 1/11 | R-b | R-b | |
| 2/11 | R-b | ||
| 3/11 | R-b | ||
| 4/11 | |||
| 5/11 | R-b | R-b | |
| 6/11 | R-b | R-b | |
| 7/11 | R-b | ||
| 8/11 | R-b | ||
| 9/11 | R-b | R-b | R-b |
| 10/11 | R-b | R-b | |
| 11/11 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v2 00/11] qemu-options: Spring cleanup
Remove support for command-line option parameters without values. Only key=val from now on. However, keep 'help' without a value.
Stop passing around pointers to booleans. This is mostly due to the handling of 'help'. In the process, fix 'help=foo' which is currently accepted.
Cleanup the arguments of qemu_opts_parse* (due to the above, but also) to stop passing in the return of qemu_opts_find() as first argument, which can return NULL and lead to segfault. Add _parse_list and _parse_list_noisily versions to keep things clear.
Replace instances of the _parse_*noisily functions with the non-noisily variant wherever possible.
CI run: https://gitlab.com/farosas/qemu/-/pipelines/2897412802
Thanks!
---
RFC:
https://lore.kernel.org/r/[email protected]
The call chain around qemu_opts_parse() is a bit convoluted. The main issues are:
- It's split in two versions, one that uses Error and another that prints messages directly.
- Callers sometimes fetch the QemuOptsList with qemu_opts_find() before calling into qemu_opts_parse, sometimes a list is already available.
- The printing of help options, warnings and errors is done at different levels, passing booleans and pointers to booleans around to get the information at the right place.
- It can't always handle a NULL list (segfaults).
https://lore.kernel.org/r/[email protected]
This series attempts to make it simpler by:
- Merging the code into a single function with wrappers taking either QemuOpts or QemuOptsList;
- Removing a couple of function arguments by always setting the Error at the leaf level and letting the callers decide what to do with it.
Plain refactoring, no functional change intended.
CI run: https://gitlab.com/farosas/qemu/-/pipelines/2862893421
Fabiano Rosas (11):
qemu-option: Use g_autofree when calling get_opt_name_value() tests/unit/test-qemu-opts: Validate help=foo options
qemu-option: Remove short form options support
qemu-option: Fix 'help' parameter parsing
qemu-option: Add qemu_opts_parse_list
qemu-option: Change qemu_parse_opts() to take the group name
qemu-option: Add qemu_opts_parse_list_noisily
qemu-option: Use qemu_opts_parse_list_noisily where appropriate
qemu-option: Change qemu_opts_parse_noisily() to take the group
qemu-option: Check for NULL list at qemu_opts_parse()
qemu-option: Remove a few instances of noisily parsing
block/monitor/block-hmp-cmds.c | 6 +- blockdev.c | 2 +- chardev/char-hmp-cmds.c | 5 +- docs/about/deprecated.rst | 13 -- include/qemu/option.h | 8 +- include/qemu/option_int.h | 1 + include/system/tpm.h | 3 +- monitor/hmp.c | 4 +- net/net.c | 4 +- plugins/loader.c | 5 +- qemu-img.c | 14 +- qemu-io-cmds.c | 2 +- qemu-io.c | 10 +- qemu-nbd.c | 6 +- semihosting/config.c | 4 +- storage-daemon/qemu-storage-daemon.c | 4 +- system/qdev-monitor.c | 2 +- system/tpm.c | 8 +- system/vl.c | 114 +++++------- tests/qemu-iotests/084 | 2 +- tests/qemu-iotests/146 | 2 +- tests/qemu-iotests/197 | 2 +- tests/qemu-iotests/215 | 2 +- tests/unit/test-char.c | 12 +- tests/unit/test-opts-visitor.c | 12 +- tests/unit/test-qemu-opts.c | 252 ++++++++++++++++----------- tests/unit/test-replication.c | 17 +- tests/unit/test-seccomp.c | 6 +- tests/unit/test-util-sockets.c | 33 ---- tools/qemu-vnc/qemu-vnc.c | 2 +- trace/control.c | 3 +- ui/vnc.c | 3 +- util/qemu-option.c | 202 +++++++++++++-------- util/qemu-sockets.c | 2 +- 34 files changed, 395 insertions(+), 372 deletions(-)
Signature · 1 line
2.53.0