[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 05/12] qapi: Track location that created an i
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v6 05/12] qapi: Track location that created an implicit type |
Date: |
Fri, 2 Oct 2015 10:13:37 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
On 10/02/2015 10:07 AM, Markus Armbruster wrote:
>>>> RFC: I used a class-level static flag to track whether we expected
>>>> 'info is None' when creating a QAPISchemaEntity. This is gross,
>>>> because the flag will only be set on the first QAPISchema() instance
>>>> (it works because none of our client scripts ever instantiate more
>>>> than one schema). But the only other thing I could think of would
>>>> be passing the QAPISchema instance into the constructor for each
>>>> QAPISchemaEntity, which is a lot of churn. Any better ideas on how
>>>> best to do the assertion, or should I just drop it?
>>>
>>> I'd check in QAPISchema._def_entity().
>>
>> Ah, instead of an assert in QAPISchemaEntity.__init__() (which requires
>> a leaky abstraction), instead write the assert into QAPISchema (so the
>> flag can now be instance-local). Makes sense; I'll play with the idea.
>
> :)
Oh, and this means accessing QAPISchemaEntity.info outside of the class,
which absolutely kills off my idea of renaming it to _info for hiding
purposes (so patch 12/12 is now officially gone).
--
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 v6 02/12] qapi: Don't use info as witness of implicit object type, (continued)
- Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type, Markus Armbruster, 2015/10/08
- Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type, Eric Blake, 2015/10/08
- Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type, Markus Armbruster, 2015/10/08
- Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type, Eric Blake, 2015/10/08
- Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type, Markus Armbruster, 2015/10/08
- Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type, Eric Blake, 2015/10/08
[Qemu-devel] [PATCH v6 05/12] qapi: Track location that created an implicit type, Eric Blake, 2015/10/08
[Qemu-devel] [PATCH v6 08/12] qapi: Defer duplicate member checks to schema check(), Eric Blake, 2015/10/08
[Qemu-devel] [PATCH v6 11/12] qapi: Detect base class loops, Eric Blake, 2015/10/08
[Qemu-devel] [PATCH v6 12/12] RFC: qapi: Hide _info member, Eric Blake, 2015/10/08
[Qemu-devel] [PATCH v6 10/12] qapi: Correct error for union branch 'kind' clash, Eric Blake, 2015/10/08
[Qemu-devel] [PATCH v6 09/12] qapi: Defer duplicate enum value checks to schema check(), Eric Blake, 2015/10/08
[Qemu-devel] [PATCH v6 01/12] qapi: Use predicate callback to determine visit filtering, Eric Blake, 2015/10/08