qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v10 24/30] qapi: Factor out QAPISchemaObjectType


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v10 24/30] qapi: Factor out QAPISchemaObjectType.check_clash()
Date: Mon, 9 Nov 2015 22:22:11 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 11/09/2015 12:11 PM, Markus Armbruster wrote:
> Eric Blake <address@hidden> writes:
> 
>> On 11/09/2015 06:00 AM, Markus Armbruster wrote:
>>> Eric Blake <address@hidden> writes:
>>>
>>>> Consolidate two common sequences of clash detection into a
>>>> new QAPISchemaObjectType.check_clash() helper method.
>>>>
>>>> No change to generated code.
>>>>
>>>> Signed-off-by: Eric Blake <address@hidden>

>>>> @@ -980,11 +980,7 @@ class QAPISchemaObjectType(QAPISchemaType):
>>>>          seen = OrderedDict()
>>>>          if self._base_name:
>>>>              self.base = schema.lookup_type(self._base_name)
>>>> -            assert isinstance(self.base, QAPISchemaObjectType)
>>>
>>> This assertion is lost.
>>>

>>
>> Directly lost, but indirectly still present.  The new code is calling
>> QAPISchemaObjectType.check_clash(), which won't exist unless self.base
>> is a QAPISchemaObjectType.
> 
> or a QAPISchemaObjectTypeMember, or a QAPISchemaObjectVariants, or
> whatever else acquires the method in the future.
> 

> 
> Maybe, but the isinstance(self.base, QAPISchemaObjectType) will come
> right back anyway when we move the "'base' for FOO cannot use BAR type"
> check from the old semantic analysis into the check methods.  Until
> then, it makes sense at least as a place holder.

Good point, I'll add it back in.

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