From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>,
"open list:qcow2" <qemu-block@nongnu.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>,
mdroth@linux.vnet.ibm.com, armbru@redhat.com,
Gerd Hoffmann <kraxel@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] qapi: use 'type' in generated C code to match QMP union wire form
Date: Mon, 27 Jul 2015 13:21:52 -0600 [thread overview]
Message-ID: <55B684D0.6090308@redhat.com> (raw)
In-Reply-To: <1438018255-23734-1-git-send-email-eblake@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1485 bytes --]
On 07/27/2015 11:30 AM, Eric Blake wrote:
> When dealing with simple qapi unions, the code was generating a
> discriminator field of 'kind' even though the discriminator is
> sent as 'type' over QMP. Renaming things to match gets us one
> step closer to reusing common generator code for both simple and
> flat unions, without having to special case the naming choice
> for simple unions.
>
> However, this patch does not rename the generated enum, which is
> still 'unionnameKind'; if we wanted, a further patch could
> generate implicit enums as 'unionnameType', with even more
> churn to C code to react, and probably update the qapi generator
> to reserve the 'fooType' namespace instead of 'fooKind'. But
> that is a lot harder, as we already have existing qapi usage
> of types that end in 'Type'.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
>
> Applies on top of Markus' "[PATCH RFC v2 00/47] qapi: QMP
> introspection". Making this cleanup would make it easier
> to switch between simple and flat unions in the future as
> needed, because the C code would always use the discriminator
> name passed over QMP.
And missing changes to tests/test-qmp-* that prevent 'make
check-qapi-schema check-unit' from passing. But I'll wait to send a v2
until after Markus' series is reposted, as there may be some rebasing
required.
--
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 --]
prev parent reply other threads:[~2015-07-27 19:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-27 17:30 [Qemu-devel] [PATCH] qapi: use 'type' in generated C code to match QMP union wire form Eric Blake
2015-07-27 19:21 ` Eric Blake [this message]
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=55B684D0.6090308@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=ehabkost@redhat.com \
--cc=famz@redhat.com \
--cc=imammedo@redhat.com \
--cc=jasowang@redhat.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.