char: QAPIfy the command line parsing
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest13 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/13 | char: Factor out qemu_chr_print_types()chardev/ include/ | +11 | 0 replies | |
| 2/13 | char: Add ChardevOptions and qemu_chr_new_cli()chardev/ include/ qapi/ | +42 | 0 replies | |
| 3/13 | char: Some QAPI aliases for CLI compatibilityqapi/ | +10 | 0 replies | |
| 4/13 | char: Add qemu_chr_translate_legacy_options()chardev/ include/ | +36 | 0 replies | |
| 5/13 | char-socket: Implement compat code for CLI QAPIficationchardev/ chardev/ include/ +2 more | +70 | 0 replies | |
| 6/13 | char-udp: Implement compat code for CLI QAPIficationchardev/ chardev/ qapi/ | +39 | 0 replies | |
| 7/13 | char: Add qemu_chr_parse_cli_dict/str()chardev/ include/ | +75 | 0 replies | |
| 8/13 | char: Add mux option to ChardevOptionschardev/ qapi/ | +38 | 3 replies | |
| 9/13 | qemu-storage-daemon: QAPIfy --chardevstorage-daemon/ | +6 | 0 replies | |
| 10/13 | char: Implement qemu_chr_new_from_opts() in terms of QAPIchardev/ | +45 | 0 replies | |
| 11/13 | hmp/char: Use qemu_chr_parse_cli_str() for chardev-changemonitor/ | +9 | 1 reply | |
| 12/13 | char: Remove qemu_chr_parse_opts()chardev/ include/ | +0 | 0 replies | |
| 13/13 | char: Remove ChardevClass.parsechardev/ chardev/ chardev/ +12 more | +0 | 0 replies |
Reviews trailers per patch
2 of 13 patches have a Reviewed-by or Acked-by.
| Patch | Marc-André Lureau | Markus Armbruster | Dr. David Alan Gilbert |
|---|---|---|---|
| 1/13 | R-b | R-b | |
| 2/13 | |||
| 3/13 | |||
| 4/13 | |||
| 5/13 | |||
| 6/13 | |||
| 7/13 | |||
| 8/13 | |||
| 9/13 | |||
| 10/13 | |||
| 11/13 | A-b | ||
| 12/13 | |||
| 13/13 |
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 00/13] char: QAPIfy the command line parsing
The character device subsystem is special in that it uses QAPI objects (ChardevBackend) internally to configure the backends, but for mapping the command line to it, instead of making use of QAPI visitors, it uses a hand-crafted parser. At the same time, the QMP command chardev-add obviously does use the QAPI parser.
This is nasty because there is nothing that will make sure that the two parsers provide access to the same feature set or that the syntax to access features is consistent. We have also seen patches that changed things for one path, but forgot that the other one needed to be changed, too, resulting in regressions.
In order to solve this problem and make consistency between both paths automatic, this series removes the hand-crafted parser that goes from QemuOpts to ChardevBackend. Instead, QAPI aliases and only a few manual tweaks of the input are used to make a keyval parser and QAPI visitors suitable for parsing command lines while retaining backwards compatibility.
As a welcome side effect, this also makes features available on the command line that were previously restricted to QMP.
Another welcome side effect is the diffstat. :-)
QemuOpts is not entirely removed from the chardev interfaces yet. This is mostly because -readconfig still uses it and changing vl.c to work with a mix of QAPI object and QemuOpts would be harder than just keeping some QemuOpts based interfaces that just internally translate. This can be addressed after -readconfig has been reworked (probably resulting in another nice diffstat).
A git tag is available that contains this series and its prerequisites:
https://repo.or.cz/qemu/kevin.git qapi-alias-chardev-v1
Based-on: [email protected]
('[PATCH 0/2] char: Deprecate backend aliases')
Based-on: [email protected] ('[PATCH 0/6] qapi: Add support for aliases')
Kevin Wolf (13):
char: Factor out qemu_chr_print_types()
char: Add ChardevOptions and qemu_chr_new_cli()
char: Some QAPI aliases for CLI compatibility
char: Add qemu_chr_translate_legacy_options()
char-socket: Implement compat code for CLI QAPIfication
char-udp: Implement compat code for CLI QAPIfication
char: Add qemu_chr_parse_cli_dict/str()
char: Add mux option to ChardevOptions
qemu-storage-daemon: QAPIfy --chardev
char: Implement qemu_chr_new_from_opts() in terms of QAPI hmp/char: Use qemu_chr_parse_cli_str() for chardev-change
char: Remove qemu_chr_parse_opts()
char: Remove ChardevClass.parse
qapi/char.json | 42 ++++- qapi/sockets.json | 6 +- include/chardev/char.h | 56 ++++-- chardev/char-file.c | 20 -- chardev/char-mux.c | 17 -- chardev/char-parallel.c | 17 -- chardev/char-pipe.c | 17 -- chardev/char-ringbuf.c | 18 -- chardev/char-serial.c | 17 -- chardev/char-socket.c | 121 +++++-------- chardev/char-stdio.c | 13 -- chardev/char-udp.c | 79 +++----- chardev/char.c | 262 ++++++++++++++++----------- chardev/spice.c | 34 ---- monitor/hmp-cmds.c | 27 +-- storage-daemon/qemu-storage-daemon.c | 17 +- ui/console.c | 35 ---- ui/gtk.c | 1 - ui/spice-app.c | 1 - 19 files changed, 321 insertions(+), 479 deletions(-)
Signature · 1 line
2.28.0