[Top][All Lists]

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

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

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

On 07/22/2015 03:21 PM, Eric Blake wrote:
> On 07/01/2015 02:22 PM, Markus Armbruster wrote:
>> Fixes flat unions to get the base's base members.  Test case is from
>> commit 2fc0043, in qapi-schema-test.json:
> Okay, I see a cause for part of my confusion.

> ...and wrote the definitions at the end (so code motion 2 is that the
> definitions are now interleaved with all other definitions).
> Attached a few quick hacks that reduce (but not eliminate) some of the
> visitor's churn to the generated files, by consolidating the location of
> the builtins and cleaning up struct declarations as separate cleanups
> (to be applied prior to 26/47), then updating the visitor to use the
> same builtin order (to be applied after or squashed with 26/47).

By the way, I'm perfectly fine if the initial conversion to the visitor
keeps .c output separate into two groups to make review easier, then a
later patch simplifies things back to a single sorting over the whole
file (and undoing the grouping after conversion to visitor will be
easier than figuring out how to interleave the builtin array visitors
into the right sorted order prior to use of the visitor).  I like the
final result of everything sorted, it's just that I think it is easier
to validate the final result when it is broken into stages with no one
step doing too much, even if some of the intermediate stages do more
work than needed and get undone by the final stage.

Or put another way, your next spin of the series could include your
original 26 + my hack 003 squashed together as one patch (conversion to
visitor with minimized generated diff noise), followed by a revert of my
hack 003 as the next (no need to group builtins together in the long run).

[and for the record, I mention this because that's the approach I took
in my earlier cleanups: commit fd41dd4e included a hack to rename 'type'
to 'struct' in the generator, so that commit 895a2a80 could be quite
mindless without touching the generator, and then commit 3e391d35 undid
my hack.  When I originally wrote the conversion in an earlier version
of the series, I did not have that hack in place and the resulting
single patch was too big; breaking it up made my submission and the
review easier.]

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]