On 11/02/2015 08:37 AM, Markus Armbruster wrote:

> 
> Not checked: variant's members don't collide with non-variant members.
> I think this check got lost when we simplified
> QAPISchemaObjectTypeVariants to hold a single member.

Yep, I found the culprit: in your v2 proposal for QAPISchema, you had:

+class QAPISchemaObjectTypeVariant(QAPISchemaObjectTypeMember):
+    def __init__(self, name, typ, flat):
+        QAPISchemaObjectTypeMember.__init__(self, name, typ, False)
+        assert isinstance(flat, bool)
+        self.flat = flat
+    def check(self, schema, tag_type, seen):
+        QAPISchemaObjectTypeMember.check(self, schema, [], seen)
+        assert self.name in tag_type.values
+        if self.flat:
+            self.type.check(schema)
+            assert isinstance(self.type, QAPISchemaObjectType)

https://lists.gnu.org/archive/html/qemu-devel/2015-07/msg00394.html

but the 'if self.flat' clause was lost in v3:

https://lists.gnu.org/archive/html/qemu-devel/2015-08/msg00450.html

I am in fact reinstating it here, but for v9, will do it in a separate
patch rather than blended in with the rest of the changes.

[wow - we've been hammering at this since July?]

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