On 11/03/2015 07:02 AM, Markus Armbruster wrote:

>>> I'm afraid you're omitting a few steps here, and I think you missed
>>> QAPISchemaObjectVariants.check()'s self.tag_member.check().
>>
>> There is no self.tag_member.check(), any more; rather, my earlier
>> patches have reworked things so that tag_member is checked by the owner
>> (a flat union's base type, a simple union's local_members, or directly
>> in QAPISchemaAlternateType prior to calling Variants.check()).  I guess
>> that's a pitfall of seeing this patch without my rework of 5/17 to
>> address your comments there.
> 
> I'm assuming this patch is based on
> [PATCH v8 06/17] qapi-types: Consolidate gen_struct() and gen_union()
> which has
> 
>     def check(self, schema, members, seen):
>         if self.tag_name:    # flat union
>             self.tag_member = seen[self.tag_name]
>         elif seen:           # simple union
>             assert self.tag_member in seen.itervalues()
>         else:                # alternate
> --->        self.tag_member.check(schema, members, seen)
> 
> in QAPISchemaObjectTypeVariants.

That was true in v8, but not in my pending v9 which did essentially what
your 7/7 did (move the tag_member.check() into Alternate.check() back in
patch 5).

At any rate, my first glance of your series shows that it is reasonable,
so my task today is to spit out a v9 of my series, but using your seven
patches in place of my four.

> Yes, we're almost certainly headed in the same direction.  But I got
> thoroughly confused and lost in the details on the way, so I had to hack
> things up myself to clear my head.  The result looks nice to me, so I'll
> send it out in a jiffie in the hope you'll find it useful.
> 

Yes, it should make v9 easier when it includes your patches, because
then you know what to look for :)

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