qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com
Subject: [Qemu-devel] [PATCH RFC 0/5] qapi: support anonymous inline base
Date: Wed, 19 Aug 2015 17:04:40 -0700	[thread overview]
Message-ID: <1440029085-14539-1-git-send-email-eblake@redhat.com> (raw)

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

             reply	other threads:[~2015-08-20  0:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-20  0:04 Eric Blake [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440029085-14539-1-git-send-email-eblake@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).