[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 20/27] qapi: Simplify QAPISchemaObjectTypeVar
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v9 20/27] qapi: Simplify QAPISchemaObjectTypeVariants.check() |
Date: |
Wed, 4 Nov 2015 16:12:56 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 11/04/2015 12:02 PM, Markus Armbruster wrote:
> Eric Blake <address@hidden> writes:
>
>> From: Markus Armbruster <address@hidden>
>>
>> Avoid the 'if seen' conditional by doing just the essential work
>> here, namely setting self.tag_member for flat unions.
>> Move the rest to callers.
>>
>> Signed-off-by: Markus Armbruster <address@hidden>
>> Message-Id: <address@hidden>
>> [reword commit, rebase to earlier AlternateType.check() changes]
>> Signed-off-by: Eric Blake <address@hidden>
>>
>> ---
>> v9: new patch
>> ---
>> scripts/qapi.py | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/scripts/qapi.py b/scripts/qapi.py
>> index 3054628..6653c70 100644
>> --- a/scripts/qapi.py
>> +++ b/scripts/qapi.py
>> @@ -988,9 +988,10 @@ class QAPISchemaObjectType(QAPISchemaType):
>> for m in self.local_members:
>> m.check(schema)
>> m.check_clash(seen)
>> + self.members = seen.values()
>> if self.variants:
>> self.variants.check(schema, seen)
>> - self.members = seen.values()
>> + assert self.variants.tag_member in self.members
>>
>> def is_implicit(self):
>> # See QAPISchema._make_implicit_object_type()
>> @@ -1053,8 +1054,6 @@ class QAPISchemaObjectTypeVariants(object):
>> # seen is non-empty for unions, empty for alternates
>
> You added this comment in PATCH 10 to explain the conditional I'm
> dropping here. Let's drop the comment, too.
Except the comment becomes relevant again in 23/27. Or maybe I just
move the comment to that point.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v9 03/27] qapi: Plug leaks in test-qmp-*, (continued)
[Qemu-devel] [PATCH v9 16/27] qapi: Eliminate QAPISchemaObjectType.check() variable members, Eric Blake, 2015/11/04
[Qemu-devel] [PATCH v9 11/27] qapi-types: Consolidate gen_struct() and gen_union(), Eric Blake, 2015/11/04
[Qemu-devel] [PATCH v9 24/27] qapi: Fix alternates that accept 'number' but not 'int', Eric Blake, 2015/11/04
[Qemu-devel] [PATCH v9 08/27] qapi: Provide nicer array names in introspection, Eric Blake, 2015/11/04
[Qemu-devel] [PATCH v9 01/27] qapi: Use generated TestStruct machinery in tests, Eric Blake, 2015/11/04
[Qemu-devel] [PATCH v9 18/27] qapi: Factor out QAPISchemaObjectTypeMember.check_clash(), Eric Blake, 2015/11/04
[Qemu-devel] [PATCH v9 20/27] qapi: Simplify QAPISchemaObjectTypeVariants.check(), Eric Blake, 2015/11/04
[Qemu-devel] [PATCH v9 15/27] qapi: Simplify QAPISchemaObjectTypeMember.check(), Eric Blake, 2015/11/04
[Qemu-devel] [PATCH v9 22/27] qapi: Remove outdated tests related to QMP/branch collisions, Eric Blake, 2015/11/04
[Qemu-devel] [PATCH v9 26/27] qapi: Remove dead visitor code, Eric Blake, 2015/11/04
[Qemu-devel] [PATCH v9 25/27] qapi: Add positive tests to qapi-schema-test, Eric Blake, 2015/11/04
[Qemu-devel] [PATCH v9 12/27] qapi-types: Simplify gen_struct_field[s], Eric Blake, 2015/11/04
[Qemu-devel] [PATCH v9 19/27] qapi: Check for qapi collisions of flat union branches, Eric Blake, 2015/11/04