[Top][All Lists]

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

Re: [Qemu-devel] [PATCH RFC v2 27/47] qapi-visit: Convert to QAPISchemaV

From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH RFC v2 27/47] qapi-visit: Convert to QAPISchemaVisitor, fixing bugs
Date: Wed, 29 Jul 2015 10:56:16 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

On 07/29/2015 02:00 AM, Markus Armbruster wrote:
>>>> We don't have any code that demonstrates this, but probably should.  I
>>>> ran into it while working up my POC of what it would take to unbox
>>>> inherited structs 
>>>> (http://thread.gmane.org/gmane.comp.emulators.qemu/353204)
>>> Is this broken in master, or do my patches break it?
>>> Got a reproducer?
>> Turns out I'm mistaken; we got lucky.  The call to
>> generate_visit_struct_fields() creates a function for 'name' (aka the
>> union name), and not for 'base' (aka the class name that owns the
>> fields).  So even if we have Base as a common struct between Child and
>> Union, the code emitted for Child generates visit_Base_fields(), while
>> the code emitted for Union generates visit_Union_fields().
>> So there is no reproducer, but _only_ as long as we reject unions as a
>> base class for any other object.  And there is redundancy: we could
>> reuse visit_Base_fields() for the sake of the union, then avoid
>> (re-)visiting the discriminator, and we would no longer need to emit
>> visit_Union_fields().  But I can do that as part of the followup
>> cleanups; since I don't see anything broken with your patch, we don't
>> have to worry about it during this series.
> Good.  Thank you!

And here's a followup patch that cleans it up:

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]