qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH] qapi: use 'type' in generated C co


From: Eric Blake
Subject: Re: [Qemu-block] [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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

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 <address@hidden>
> ---
> 
> 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: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]