[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH RFC 0/5] qapi: support anonymous inline base
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH RFC 0/5] qapi: support anonymous inline base |
Date: |
Wed, 19 Aug 2015 17:04:40 -0700 |
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
--
2.4.3
- [Qemu-devel] [PATCH RFC 0/5] qapi: support anonymous inline base,
Eric Blake <=
- [Qemu-devel] [PATCH RFC 1/5] qapi: Reuse code for flat union base validation, Eric Blake, 2015/08/19
- [Qemu-devel] [PATCH RFC 4/5] qapi: Simplify visits of optional fields, Eric Blake, 2015/08/19
- [Qemu-devel] [PATCH RFC 3/5] qapi: Merge generation of per-member visits, Eric Blake, 2015/08/20
- [Qemu-devel] [PATCH RFC 5/5] qapi: Allow anonymous base for flat union, Eric Blake, 2015/08/20
- [Qemu-devel] [PATCH RFC 2/5] qapi: Generate consistent variable names, Eric Blake, 2015/08/20