qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH RFC 0/5] qapi: support anonymous inline base
@ 2015-08-20  0:04 Eric Blake
  2015-08-20  0:04 ` [Qemu-devel] [PATCH RFC 1/5] qapi: Reuse code for flat union base validation Eric Blake
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Eric Blake @ 2015-08-20  0:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: armbru

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-08-22  3:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-20  0:04 [Qemu-devel] [PATCH RFC 0/5] qapi: support anonymous inline base Eric Blake
2015-08-20  0:04 ` [Qemu-devel] [PATCH RFC 1/5] qapi: Reuse code for flat union base validation Eric Blake
2015-08-20  0:04 ` [Qemu-devel] [PATCH RFC 2/5] qapi: Generate consistent variable names Eric Blake
2015-08-20  0:04 ` [Qemu-devel] [PATCH RFC 3/5] qapi: Merge generation of per-member visits Eric Blake
2015-08-20  0:04 ` [Qemu-devel] [PATCH RFC 4/5] qapi: Simplify visits of optional fields Eric Blake
2015-08-20  0:04 ` [Qemu-devel] [PATCH RFC 5/5] qapi: Allow anonymous base for flat union Eric Blake
2015-08-22  3:48   ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).