[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 09/46] qapi: Use consistent generated code pa
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v5 09/46] qapi: Use consistent generated code patterns |
Date: |
Fri, 25 Sep 2015 13:06:57 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
On 09/25/2015 10:54 AM, Markus Armbruster wrote:
> Eric Blake <address@hidden> writes:
>
>> We had some pointless differences in the generated code for visit,
>> command marshalling, and events; unifying them makes it easier for
>> future patches to consolidate to common helper functions.
>> - Consistently name the error variable 'err'
>
> Before the patch, qapi-event.py consistently uses local_err, and
> qapi-commands.py uses both names. I like your change.
>
>> - Consistently use the labels 'out' and 'out_obj'
>
> Before, qapi-event.py consistently uses 'clean', and qapi-visit.py uses
> both 'out_obj' and 'out_end'. Good change.
>
>> - If allocation fails, jump to the right label rather than
>> indenting everything else
>
> Good idea. Just one instance, in gen_visit_union().
>
> Not mentioned: name the Visitor * parameter 'v' instead of 'm'.
Whoops - I merged several patches from v4 into just this one for v5, but
forgot to update the commit message to match.
> No idea
> where that 'm' comes from, but it has spilled over into qom/object.c and
> qom/qom-object.c. Let's ignore that for now.
I didn't even notice that.
>
>> No change in semantics to the generated code.
>
> Yes, but you need to update docs/qapi-code-gen.txt.
Indeed.
>
> Pretty mechanical changes. They look good to me, but as always, this
> kind is easier to review when you do exactly one mechanical change per
> patch.
Sounds like my merge was premature; I'll split this back out into
separate patches, and update the docs to match (where things are
affected - our docs don't give any examples of the C code for visiting a
union).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
[Qemu-devel] [PATCH v5 08/46] qapi: Reuse code for flat union base validation, Eric Blake, 2015/09/21
[Qemu-devel] [PATCH v5 09/46] qapi: Use consistent generated code patterns, Eric Blake, 2015/09/21
[Qemu-devel] [PATCH v5 10/46] qapi: Merge generation of per-member visits, Eric Blake, 2015/09/21
[Qemu-devel] [PATCH v5 11/46] qapi: Don't use info as witness of implicit object type, Eric Blake, 2015/09/21
[Qemu-devel] [PATCH v5 12/46] qapi: Track location that created an implicit type, Eric Blake, 2015/09/21
[Qemu-devel] [PATCH v5 14/46] qapi: Detect collisions in C member names, Eric Blake, 2015/09/21