RFC qapi: support anonymous inline base
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest5 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | qapi: Reuse code for flat union base validationscripts/ tests/ tests/ +5 more | +13 | 0 replies | |
| 2/5 | qapi: Generate consistent variable namesscripts/ scripts/ scripts/ | +55 | 0 replies | |
| 3/5 | qapi: Merge generation of per-member visitsscripts/ scripts/ scripts/ | +47 | 0 replies | |
| 4/5 | qapi: Simplify visits of optional fieldsinclude/ include/ qapi/ +4 more | +11 | 0 replies | |
| 5/5 | qapi: Allow anonymous base for flat unionscripts/ scripts/ scripts/ +8 more | +41 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Qemu-devel] [PATCH RFC 0/5] qapi: support anonymous inline base
Existing flat unions have to specify a separate base class:
{ 'struct':'Base', 'data': { common... } }
{ 'union':'Flat', 'base': 'Base', 'discriminator':... }
but we often don't care about reusing the base member by itself. Since we already support anonymous structs for commands, it is not that much harder to do likewise for the common members of the flat union:
{ 'union':'Flat', 'base': { common... }, 'discriminator':... }
And, as usual, it cleans up other things as prerequisites.
RFC because it depends on two pending series:
https://lists.gnu.org/archive/html/qemu-devel/2015-08/msg00426.html
https://lists.gnu.org/archive/html/qemu-devel/2015-08/msg02059.html
Eric Blake (5):
qapi: Reuse code for flat union base validation
qapi: Generate consistent variable names
qapi: Merge generation of per-member visits
qapi: Simplify visits of optional fields
qapi: Allow anonymous base for flat union
include/qapi/visitor-impl.h | 3 +- include/qapi/visitor.h | 5 +- qapi/opts-visitor.c | 2 +- qapi/qapi-visit-core.c | 6 +- qapi/qmp-input-visitor.c | 3 +- qapi/string-input-visitor.c | 3 +- scripts/qapi-commands.py | 57 ++++------------- scripts/qapi-event.py | 22 +++---- scripts/qapi-types.py | 2 +- scripts/qapi-visit.py | 99 ++++++++++++----------------- scripts/qapi.py | 78 ++++++++++++++++++----- tests/Makefile | 3 +- tests/qapi-schema/flat-union-bad-base.err | 1 - tests/qapi-schema/flat-union-bad-base.exit | 1 - tests/qapi-schema/flat-union-bad-base.json | 13 ---- tests/qapi-schema/flat-union-bad-base.out | 0 tests/qapi-schema/flat-union-base-any.err | 2 +- tests/qapi-schema/flat-union-base-union.err | 2 +- tests/qapi-schema/flat-union-inline.err | 2 +- tests/qapi-schema/flat-union-inline.json | 4 +- tests/qapi-schema/flat-union-no-base.err | 2 +- tests/qapi-schema/qapi-schema-test.json | 2 +- tests/qapi-schema/qapi-schema-test.out | 5 +- tests/qapi-schema/union-invalid-base.err | 2 +- 24 files changed, 149 insertions(+), 170 deletions(-) delete mode 100644 tests/qapi-schema/flat-union-bad-base.err delete mode 100644 tests/qapi-schema/flat-union-bad-base.exit delete mode 100644 tests/qapi-schema/flat-union-bad-base.json delete mode 100644 tests/qapi-schema/flat-union-bad-base.out
Signature · 1 line
2.4.3