On 09/03/2015 08:29 AM, Markus Armbruster wrote: > The QAPI code generators work with a syntax tree (nested dictionaries) > plus a few symbol tables (also dictionaries) on the side. >
> Signed-off-by: Markus Armbruster <arm...@redhat.com> > Reviewed-by: Eric Blake <ebl...@redhat.com> > --- > +class QAPISchemaObjectTypeVariants(object): > + def __init__(self, tag_name, tag_enum, variants): > + assert tag_name == None or isinstance(tag_name, str) > + assert tag_enum == None or isinstance(tag_enum, str) > + for v in variants: > + assert isinstance(v, QAPISchemaObjectTypeVariant) > + self.tag_name = tag_name > + if tag_name: > + assert not tag_enum > + self.tag_member = None > + else: > + self.tag_member = QAPISchemaObjectTypeMember('kind', tag_enum, > + False) See my review on 30/32. Introspection-wise, we want this generated member to be named 'type' to match what is on the wire. This patch, plus two more to qapi-types.py and qapi-visit.py, are sufficient to make no changes to the other generated files, while fixing the bug in qmp-introspect.c: diff --git i/scripts/qapi.py w/scripts/qapi.py index d2b6964..b2643af 100644 --- i/scripts/qapi.py +++ w/scripts/qapi.py @@ -928,7 +928,7 @@ class QAPISchemaObjectTypeVariants(object): assert not tag_enum self.tag_member = None else: - self.tag_member = QAPISchemaObjectTypeMember('kind', tag_enum, + self.tag_member = QAPISchemaObjectTypeMember('type', tag_enum, False) self.variants = variants def check(self, schema, members, seen): -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature