RFC qemu-options: Remove some complexity
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest14 patches 15 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/14 | meson: Fix meson suites invocation from make checkscripts/ tests/ | +10 | 1 reply | |
| 2/14 | qemu-options: Use g_autofree when calling get_opt_name_value()util/ | +11 | 1 reply | |
| 3/14 | qemu-options: Consolidate branches in opts_parseutil/ | +2 | 1 reply | |
| 4/14 | qemu-options: Add qemu_opts_parse_listinclude/ tests/ util/ +1 more | +104 | 1 reply | |
| 5/14 | qemu-options: Change qemu_parse_opts() to take the group nameinclude/ system/ tests/ +1 more | +18 | 1 reply | |
| 6/14 | qemu-options: Call qemu_opts_print_help() one level downutil/ | +12 | 1 reply | |
| 7/14 | qemu-options: Consolidate qemu_opts_parse* functionstests/ util/ | +19 | 4 replies | |
| 8/14 | qemu-options: Add qemu_opts_parse_list_noisilyblock/ include/ monitor/ +12 more | +43 | 1 reply | |
| 9/14 | qemu-options: Change qemu_opts_parse_noisily() to take the groupblock/ blockdev.c chardev/ +10 more | +54 | 2 replies | |
| 10/14 | qemu-options: Check for NULL list at qemu_opts_parse()util/ | +4 | 1 reply | |
| 11/14 | qemu-options: pass an Error into get_opt_name_valueutil/ | +17 | 1 reply | |
| 12/14 | qemu-options: merge warn and help flagsutil/ | +14 | 0 replies | |
| 13/14 | qemu-options: Further simplify qemu_opts_parse_list()util/ | +7 | 0 replies | |
| 14/14 | qemu-options: Remove opts_parse()util/ | +10 | 0 replies |
Reviews trailers per patch
7 of 14 patches have a Reviewed-by or Acked-by.
| Patch | Stefan Hajnoczi | Daniel P. Berrangé |
|---|---|---|
| 1/14 | ||
| 2/14 | R-b | |
| 3/14 | R-b | |
| 4/14 | R-b | |
| 5/14 | R-b | |
| 6/14 | R-b | |
| 7/14 | ||
| 8/14 | ||
| 9/14 | R-b | R-b |
| 10/14 | R-b | |
| 11/14 | ||
| 12/14 | ||
| 13/14 | ||
| 14/14 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [RFC PATCH 00/14] qemu-options: Remove some complexity
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 (14):
meson: Fix meson suites invocation from make check
qemu-options: Use g_autofree when calling get_opt_name_value()
qemu-options: Consolidate branches in opts_parse
qemu-options: Add qemu_opts_parse_list
qemu-options: Change qemu_parse_opts() to take the group name
qemu-options: Call qemu_opts_print_help() one level down
qemu-options: Consolidate qemu_opts_parse* functions
qemu-options: Add qemu_opts_parse_list_noisily
qemu-options: Change qemu_opts_parse_noisily() to take the group
qemu-options: Check for NULL list at qemu_opts_parse()
qemu-options: pass an Error into get_opt_name_value
qemu-options: merge warn and help flags
qemu-options: Further simplify qemu_opts_parse_list()
qemu-options: Remove opts_parse()
block/monitor/block-hmp-cmds.c | 4 +- blockdev.c | 2 +- chardev/char-hmp-cmds.c | 5 +- include/qemu/option.h | 8 +- monitor/hmp.c | 2 +- net/net.c | 2 +- plugins/loader.c | 2 +- qemu-img.c | 13 +- qemu-io-cmds.c | 2 +- qemu-io.c | 7 +- qemu-nbd.c | 6 +- scripts/mtest2make.py | 11 +- semihosting/config.c | 4 +- storage-daemon/qemu-storage-daemon.c | 4 +- system/qdev-monitor.c | 2 +- system/tpm.c | 2 +- system/vl.c | 86 +++++------- tests/qemu-iotests/meson.build | 2 +- tests/unit/test-char.c | 12 +- tests/unit/test-opts-visitor.c | 12 +- tests/unit/test-qemu-opts.c | 169 ++++++++++++----------- tests/unit/test-replication.c | 6 +- tests/unit/test-seccomp.c | 6 +- tools/qemu-vnc/qemu-vnc.c | 2 +- trace/control.c | 3 +- ui/vnc.c | 3 +- util/qemu-option.c | 197 ++++++++++++++++----------- util/qemu-sockets.c | 2 +- 28 files changed, 293 insertions(+), 283 deletions(-)
Signature · 1 line
2.53.0