qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v8.5 1/4] qapi: Drop all_members parameter from


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v8.5 1/4] qapi: Drop all_members parameter from check()
Date: Tue, 03 Nov 2015 17:19:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eric Blake <address@hidden> writes:

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

Buyer beware: I'm not sure my seven do everything your four do.

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

I hope I'll be less easily confused going forward...



reply via email to

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