[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v8 11/18] qapi: Simplify gen_struct_field()
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v8 11/18] qapi: Simplify gen_struct_field() |
Date: |
Tue, 13 Oct 2015 07:11:48 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 10/13/2015 06:12 AM, Markus Armbruster wrote:
> Eric Blake <address@hidden> writes:
>
>> Rather than having all callers pass a name, type, and optional
>> flag, have them instead pass a QAPISchemaObjectTypeMember which
>> already has all that information.
>>
>> This will allow a future patch to simplify alternates to use
>> a special tag 'qtype_code type'. In the meantime, it requires
>> a hack to create a temporary member 'base' for struct base
>> classes; this temporary member will go away in a later patch
>> that flattens structs in the same way that flat union base
>> classes were flattened in commit 1e6c1616.
>>
>> No change to generated code.
>>
>> Signed-off-by: Eric Blake <address@hidden>
>>
>>
>> if base:
>> - ret += gen_struct_field('base', base, False)
>> + # TODO Flatten this struct, similar to flat union bases. Until
>> + # then, hack around it with a temporary member.
>> + member = QAPISchemaObjectTypeMember('base', base.name, False)
>> + member.type = base
>> + ret += gen_struct_field(member)
>>
>> ret += gen_struct_fields(members)
>
> Uff! Are you really, really sure this is the right spot in the series
> for this transformation?
Serves me right for sending the series late at night. I can probably
delay this transformation to a later subset, after I have unboxed struct
base members, so I won't need this hack. And I just confirmed that
nothing else in subset B depends on this patch, so let's defer it to
subset C or later (dropping from this series is not sufficient reason
for a v9 respin, but if something else turns up that needs a v9, this
patch has been moved out).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v8 01/18] qapi: Use predicate callback to determine visit filtering, (continued)
- [Qemu-devel] [PATCH v8 01/18] qapi: Use predicate callback to determine visit filtering, Eric Blake, 2015/10/13
- [Qemu-devel] [PATCH v8 07/18] qapi: Don't use info as witness of implicit object type, Eric Blake, 2015/10/13
- [Qemu-devel] [PATCH v8 08/18] qapi: Lazy creation of array types, Eric Blake, 2015/10/13
- [Qemu-devel] [PATCH v8 14/18] qapi: Detect collisions in C member names, Eric Blake, 2015/10/13
- [Qemu-devel] [PATCH v8 11/18] qapi: Simplify gen_struct_field(), Eric Blake, 2015/10/13
- [Qemu-devel] [PATCH v8 09/18] qapi: Create simple union type member earlier, Eric Blake, 2015/10/13
- [Qemu-devel] [PATCH v8 12/18] qapi: Track location that created an implicit type, Eric Blake, 2015/10/13
- [Qemu-devel] [PATCH v8 10/18] qapi: Move union tag quirks into subclass, Eric Blake, 2015/10/13
- [Qemu-devel] [PATCH v8 15/18] qapi: Move duplicate member checks to schema check(), Eric Blake, 2015/10/13