Skip to content

RFC Command line QAPIfication

Markus Armbruster qemu-devel qemu-trivial 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest32 patches 28 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/32tests/qapi-schema: Improve coverage of '@'tests/qapi-schema/doc-good.json tests/qapi-schema/doc-good.out tests/qapi-schema/doc-good.texi+10 -01 reply
2/32texi2pod: Support @verbatim environmentscripts/texi2pod.pl+9 -23 replies
3/32qapi2texi: Fix for examples containing '@'scripts/qapi2texi.py tests/qapi-schema/doc-good.json tests/qapi-schema/doc-good.out +1 more+15 -171 reply
4/32qapi2texi: Fix for '@' not followed by \w characterscripts/qapi2texi.py tests/qapi-schema/doc-good.json tests/qapi-schema/doc-good.out +1 more+15 -131 reply
5/32qapi2texi: Provide access to Texinfo markupdocs/devel/qapi-code-gen.txt scripts/qapi2texi.py tests/qapi-schema/doc-good.json +2 more+60 -30 replies
6/32qapi2texi: Drop | example markupdocs/devel/qapi-code-gen.txt qapi-schema.json scripts/qapi2texi.py +3 more+22 -310 replies
7/32qapi: Drop superfluous allow_optional=Truescripts/qapi.py+1 -11 reply
8/32qapi: Simplify check_name() parametersscripts/qapi.py+10 -122 replies
9/32qapi: check_type() parameter allow_optional is now unused, dropscripts/qapi.py+5 -81 reply
10/32qapi: Don't run generators twiceMakefile Makefile.objs tests/Makefile.include+64 -321 reply
11/32qapi: Drop the options to generate only .c or .hscripts/qapi-commands.py scripts/qapi-event.py scripts/qapi-introspect.py +3 more+14 -311 reply
12/32qapi: Use argparse to parse command line argumentsscripts/qapi-commands.py scripts/qapi-event.py scripts/qapi-introspect.py +5 more+74 -981 reply
13/32qapi: Use argparse to open schema filescripts/qapi.py scripts/qapi2texi.py tests/qapi-schema/test-qapi.py+5 -51 reply
14/32qapi: Rework generated code for built-in types.gitignore Makefile Makefile.objs +24 more+127 -1442 replies
15/32tests/qapi-schema: Improve simple union coveragetests/qapi-schema/qapi-schema-test.json tests/qapi-schema/qapi-schema-test.out+16 -02 replies
16/32qapi: Factor out _make_implicit_wrapper_type()scripts/qapi.py+6 -21 reply
17/32qapi: Fix simple union lowering with multiple schemasscripts/qapi-types.py scripts/qapi.py tests/qapi-schema/builtins.out +2 more+43 -91 reply
18/32docs/devel/qapi-code-gen.txt: Rewrite section on schema syntaxdocs/devel/qapi-code-gen.txt+18 -181 reply
19/32qapi: Accept double-quoted stringsdocs/devel/qapi-code-gen.txt scripts/qapi.py tests/qapi-schema/qapi-schema-test.json+7 -56 replies
20/32qapi: Frontend for defining command line optionsscripts/qapi.py tests/qapi-schema/qapi-schema-test.json tests/qapi-schema/qapi-schema-test.out +1 more+154 -00 replies
21/32qapi: Define QAPIOptionKind and QAPIOption automaticallyscripts/qapi-commands.py scripts/qapi-event.py scripts/qapi-introspect.py +6 more+61 -90 replies
22/32qapi: New helper c_string()scripts/qapi-introspect.py scripts/qapi.py+17 -60 replies
23/32qapi-options: Command line option backendMakefile Makefile.objs scripts/qapi-options.py +2 more+297 -40 replies
24/32qapi-options: Generate help stringscripts/qapi-options.py+13 -00 replies
25/32qapi-introspect: Include command line options informationqapi/introspect.json scripts/qapi-introspect.py+29 -30 replies
26/32qapi2texi: Include command line options informationscripts/qapi2texi.py tests/qapi-schema/doc-good.json tests/qapi-schema/doc-good.out +1 more+129 -00 replies
27/32os-posix: Drop misleading commentos-posix.c+0 -11 reply
28/32vl: QAPIfy command line option definition.gitignore Makefile include/qemu-common.h +10 more+4961 -47110 replies
29/32qapi/options: QAPIfy --echr argument typeqapi/options.json vl.c+3 -90 replies
30/32qapi/options: QAPIfy --watchdog-action argument typeqapi/options.json vl.c+3 -60 replies
31/32qapi/options: QAPIfy --blockdev argument typeqapi/options.json vl.c+8 -360 replies
32/32qapi/options: QAPIfy --add-fd argument typeqapi/options.json vl.c+17 -550 replies

Reviews trailers per patch

16 of 32 patches have a Reviewed-by or Acked-by.

PatchMarc-André LureauEric Blake
1/32R-b
2/32R-b
3/32
4/32R-b
5/32
6/32
7/32R-b
8/32R-b R-b
9/32R-b
10/32R-b
11/32R-b
12/32R-b
13/32R-b
14/32R-b
15/32R-b
16/32R-b
17/32R-b
18/32R-b
19/32
20/32
21/32
22/32
23/32
24/32
25/32
26/32
27/32R-b
28/32
29/32
30/32
31/32
32/32

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

Read the v1 thread

Cover letter [Qemu-devel] [RFC PATCH 00/32] Command line QAPIfication

This is a prototype to demonstrate where I'm headed. PATCH 01-28 are infrastructure, PATCH 29-32 QAPIfy a few options.

Plenty of infrastrucure work remains. Some of it is marked TODO/FIXME in the patches. I've excluded work to improve backward keyval.c compatibility with QemuOpts quirks for now.

Command line introspection is provided by query-qmp-schema for now. Perhaps it should be separate. See PATCH 25.

Documentation is generated into qemu-qmp-ref.*. Perhaps it should be separate. See PATCH 26.

main() iterates over argv[] twice. The second loop "executes" some options directly. PATCH 29+30 QAPIfy two of them. Other options it converts into a more convenient form, for later execution. PATCH 31+32 QAPIfy two of them: the conversion becomes a no-op, because QAPIfication already produces a convenient data type.

"Later execution" means the command line is executed in some magic order mortal users can't predict. Strict left-to-right would be simpler and cleaner, but backward compatibility may compel us to remain complicated and unclean.

qemu-img already duplicates --option. I suspect we'll end up wanting to QAPIfy that as well, sharing the common part of the QAPI schema.

Based-on: [email protected]

    [PULL 0/3] QAPI patches for 2017-10-02
Based-on: [email protected]
    [PATCH 0/3] hmp-commands-info: Texinfo fixes
Based-on: [email protected]
    [PATCH 0/8] qemu-options: Texinfo and --help fixes

Based-on: [email protected]
[PATCH 00/11] qapi: Cleanups around qapi2texi

Markus Armbruster (32):
tests/qapi-schema: Improve coverage of '@'
texi2pod: Support @verbatim environment
qapi2texi: Fix for examples containing '@'
qapi2texi: Fix for '@' not followed by \w character
qapi2texi: Provide access to Texinfo markup
qapi2texi: Drop | example markup
qapi: Drop superfluous allow_optional=True
qapi: Simplify check_name() parameters
qapi: check_type() parameter allow_optional is now unused, drop
qapi: Don't run generators twice
qapi: Drop the options to generate only .c or .h
qapi: Use argparse to parse command line arguments
qapi: Use argparse to open schema file
qapi: Rework generated code for built-in types tests/qapi-schema: Improve simple union coverage
qapi: Factor out _make_implicit_wrapper_type()
qapi: Fix simple union lowering with multiple schemas docs/devel/qapi-code-gen.txt: Rewrite section on schema syntax
qapi: Accept double-quoted strings
qapi: Frontend for defining command line options
qapi: Define QAPIOptionKind and QAPIOption automatically
qapi: New helper c_string()
qapi-options: Command line option backend
qapi-options: Generate help string
qapi-introspect: Include command line options information
qapi2texi: Include command line options information
os-posix: Drop misleading comment
vl: QAPIfy command line option definition qapi/options: QAPIfy --echr argument type qapi/options: QAPIfy --watchdog-action argument type qapi/options: QAPIfy --blockdev argument type qapi/options: QAPIfy --add-fd argument type

 .gitignore                               |    4 +-
 Makefile                                 |  101 +-
 Makefile.objs                            |    4 +-
 docs/devel/qapi-code-gen.txt             |   83 +-
 include/qemu-common.h                    |    2 +-
 os-posix.c                               |   27 +-
 os-win32.c                               |    3 +-
 qapi-schema.json                         |    9 +-
 qapi/introspect.json                     |   22 +-
 qapi/options.json                        | 4574 ++++++++++++++++++++++++++++++
 qemu-doc.texi                            |    4 +-
 qemu-options-wrapper.h                   |   41 -
 qemu-options.h                           |   36 -
 qemu-options.hx                          | 4256 ---------------------------
 qga/Makefile.objs                        |    1 +
 scripts/qapi-commands.py                 |   13 +-
 scripts/qapi-event.py                    |   12 +-
 scripts/qapi-introspect.py               |   44 +-
 scripts/qapi-options.py                  |  212 ++
 scripts/qapi-types.py                    |   78 +-
 scripts/qapi-visit.py                    |   74 +-
 scripts/qapi.py                          |  350 ++-
 scripts/qapi2texi.py                     |   88 +-
 scripts/texi2pod.pl                      |   11 +-
 tests/Makefile.include                   |   56 +-
 tests/qapi-schema/builtins.err           |    0
 tests/qapi-schema/builtins.exit          |    1 +
 tests/qapi-schema/builtins.json          |    1 +
 tests/qapi-schema/builtins.out           |   33 +
 tests/qapi-schema/comments.out           |    3 -
 tests/qapi-schema/doc-bad-section.out    |    3 -
 tests/qapi-schema/doc-good.json          |   46 +-
 tests/qapi-schema/doc-good.out           |   70 +-
 tests/qapi-schema/doc-good.texi          |   82 +-
 tests/qapi-schema/empty.out              |    3 -
 tests/qapi-schema/event-case.out         |    3 -
 tests/qapi-schema/ident-with-escape.out  |    3 -
 tests/qapi-schema/include-relpath.out    |    3 -
 tests/qapi-schema/include-repetition.out |    3 -
 tests/qapi-schema/include-simple.out     |    3 -
 tests/qapi-schema/indented-expr.out      |    3 -
 tests/qapi-schema/qapi-schema-test.json  |   26 +-
 tests/qapi-schema/qapi-schema-test.out   |   64 +-
 tests/qapi-schema/test-qapi.py           |   22 +-
 tests/test-qapi-options.c                |   74 +
 vl.c                                     |  809 +++---
 46 files changed, 6151 insertions(+), 5209 deletions(-)
 create mode 100644 qapi/options.json
 delete mode 100644 qemu-options-wrapper.h
 delete mode 100644 qemu-options.h
 delete mode 100644 qemu-options.hx
 create mode 100644 scripts/qapi-options.py
 create mode 100644 tests/qapi-schema/builtins.err
 create mode 100644 tests/qapi-schema/builtins.exit
 create mode 100644 tests/qapi-schema/builtins.json
 create mode 100644 tests/qapi-schema/builtins.out
 create mode 100644 tests/test-qapi-options.c
Signature · 1 line
2.13.6