qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RFC v4 02/32] qapi: New QAPISchema intermediate


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH RFC v4 02/32] qapi: New QAPISchema intermediate reperesentation
Date: Thu, 3 Sep 2015 21:05:06 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

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 <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> ---

> +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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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