From: Eric Blake <eblake@redhat.com>
To: Wenchao Xia <xiawenc@linux.vnet.ibm.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, mdroth@linux.vnet.ibm.com, armbru@redhat.com,
lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH V6 00/10] qapi script: support enum as discriminator and better enum name
Date: Tue, 11 Feb 2014 06:17:04 -0700 [thread overview]
Message-ID: <52FA22D0.70407@redhat.com> (raw)
In-Reply-To: <1392068921-3327-1-git-send-email-xiawenc@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1221 bytes --]
On 02/10/2014 02:48 PM, Wenchao Xia wrote:
> This series address two issues:
>
> 1. support using enum as discriminator in union.
> For example, if we have following define in qapi schema:
> { 'enum': 'EnumOne',
> 'data': [ 'value1', 'value2', 'value3' ] }
>
> { 'type': 'UserDefBase0',
> 'data': { 'base-string0': 'str', 'base-enum0': 'EnumOne' } }
>
> Before this series, discriminator in union must be a string, and a
> hidden enum type as discriminator is generated. After this series,
> qapi schema can directly use predefined enum type:
> { 'union': 'UserDefEnumDiscriminatorUnion',
> 'base': 'UserDefBase0',
> 'discriminator' : 'base-enum0',
> 'data': { 'value1' : 'UserDefA',
> 'value2' : 'UserDefInherit',
> 'value3' : 'UserDefB' } }
See also:
https://lists.gnu.org/archive/html/qemu-devel/2014-02/msg01663.html
There, I argued that even unions without a 'base':'TypeName' would
benefit from having a discriminator that calls out an enum type listing
the valid branches of the union. I think that could be a followup to
this series.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2014-02-11 13:17 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-10 21:48 [Qemu-devel] [PATCH V6 00/10] qapi script: support enum as discriminator and better enum name Wenchao Xia
2014-02-10 21:48 ` [Qemu-devel] [PATCH V6 01/10] qapi script: remember enum values Wenchao Xia
2014-02-10 21:48 ` [Qemu-devel] [PATCH V6 02/10] qapi script: add check for duplicated key Wenchao Xia
2014-02-13 15:14 ` Markus Armbruster
2014-02-14 1:50 ` Wenchao Xia
2014-02-17 8:28 ` Markus Armbruster
2014-02-10 21:48 ` [Qemu-devel] [PATCH V6 03/10] qapi script: check correctness of discriminator values in union Wenchao Xia
2014-02-13 15:14 ` Markus Armbruster
2014-02-14 2:43 ` Wenchao Xia
2014-02-14 9:23 ` Markus Armbruster
2014-02-17 1:50 ` Wenchao Xia
2014-02-17 8:11 ` Markus Armbruster
2014-02-17 13:59 ` Luiz Capitulino
2014-02-10 21:48 ` [Qemu-devel] [PATCH V6 04/10] qapi script: code move for generate_enum_name() Wenchao Xia
2014-02-10 21:48 ` [Qemu-devel] [PATCH V6 05/10] qapi script: use same function to generate enum string Wenchao Xia
2014-02-10 21:48 ` [Qemu-devel] [PATCH V6 06/10] qapi script: support pre-defined enum type as discriminator in union Wenchao Xia
2014-02-10 21:48 ` [Qemu-devel] [PATCH V6 07/10] qapi: convert BlockdevOptions to use enum discriminator Wenchao Xia
2014-02-10 21:48 ` [Qemu-devel] [PATCH V6 08/10] qapi script: do not allow string discriminator Wenchao Xia
2014-02-13 15:18 ` Markus Armbruster
2014-02-10 21:48 ` [Qemu-devel] [PATCH V6 09/10] tests: add cases for inherited struct and union with discriminator Wenchao Xia
2014-02-13 14:53 ` Markus Armbruster
2014-02-13 15:11 ` Luiz Capitulino
2014-02-14 2:47 ` Wenchao Xia
2014-02-10 21:48 ` [Qemu-devel] [PATCH V6 10/10] qapi script: do not add "_" for every capitalized char in enum Wenchao Xia
2014-02-11 13:17 ` Eric Blake [this message]
2014-02-11 19:13 ` [Qemu-devel] [PATCH V6 00/10] qapi script: support enum as discriminator and better enum name Luiz Capitulino
2014-02-13 15:22 ` Luiz Capitulino
2014-02-13 15:23 ` Markus Armbruster
2014-02-14 2:53 ` Wenchao Xia
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=52FA22D0.70407@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=xiawenc@linux.vnet.ibm.com \
/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).