[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: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v5 09/46] qapi: Use consistent generated code patterns |
Date: |
Fri, 25 Sep 2015 18:54:52 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
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'. 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.
> No change in semantics to the generated code.
Yes, but you need to update docs/qapi-code-gen.txt.
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.
[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
- Re: [Qemu-devel] [PATCH v5 09/46] qapi: Use consistent generated code patterns,
Markus Armbruster <=
[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