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