From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v5 07/14] qapi: Utilize implicit struct visits
Date: Thu, 10 Mar 2016 13:16:51 -0700 [thread overview]
Message-ID: <56E1D633.8030400@redhat.com> (raw)
In-Reply-To: <87r3fip2zx.fsf@blackfin.pond.sub.org>
[-- Attachment #1: Type: text/plain, Size: 1894 bytes --]
On 03/10/2016 12:05 PM, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
>
>> Rather than generate inline per-member visits, take advantage
>> of the 'visit_type_FOO_members()' function for both event and
>> command marshalling. This is possible now that implicit
>> structs can be visited like any other.
>>
>> Likewise, command marshalling generates call arguments from a
>> stack-allocated struct, rather than a list of local variables:
>>
>> |- goto out;
>> |- }
>> |+ q_obj_add_fd_arg qapi = {0};
>
> Let's calls this arg.
Sure.
>
>> |+
>> |+ v = qmp_input_get_visitor(qiv);
>> |+ visit_type_q_obj_add_fd_arg_members(v, &qapi, &err);
>> |+ if (err) {
>> |+ goto out;
>> | }
>> |
>> |- retval = qmp_add_fd(has_fdset_id, fdset_id, has_opaque, opaque, &err);
>> |+ retval = qmp_add_fd(qapi.has_fdset_id, qapi.fdset_id, qapi.has_opaque, qapi.opaque, &err);
and this line then gets a bit shorter.
>> +++ b/scripts/qapi-event.py
>> @@ -28,6 +28,30 @@ def gen_event_send_decl(name, arg_type):
>> proto=gen_event_send_proto(name, arg_type))
>> @@ -50,6 +74,7 @@ def gen_event_send(name, arg_type):
>> QmpOutputVisitor *qov;
>> Visitor *v;
>> ''')
>> + ret += gen_param_var(arg_type)
>>
>> ret += mcgen('''
>>
This is why I moved the blank line in 6/14. But I can rearrange things
as you requested.
I'm also wondering if this should be split into two patches (one for
qapi-visit, one for qapi-commands); when I first started writing it, I
thought there would be some code sharing between the two with edits to
qapi.py (see the v4 posting); but now they are distinct enough that two
commits is just as easy to do.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2016-03-10 20:16 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-10 0:55 [Qemu-devel] [PATCH v5 00/14] easier unboxed visits/qapi implicit types Eric Blake
2016-03-10 0:55 ` [Qemu-devel] [PATCH v5 01/14] qapi: Assert in places where variants are not handled Eric Blake
2016-03-10 0:55 ` [Qemu-devel] [PATCH v5 02/14] qapi: Fix command with named empty argument type Eric Blake
2016-03-10 0:55 ` [Qemu-devel] [PATCH v5 03/14] qapi: Make c_type() more OO-like Eric Blake
2016-03-10 0:55 ` [Qemu-devel] [PATCH v5 04/14] qapi: Adjust names of implicit types Eric Blake
2016-03-10 13:39 ` Markus Armbruster
2016-03-10 16:11 ` Eric Blake
2016-03-11 7:48 ` Markus Armbruster
2016-03-11 17:29 ` Eric Blake
2016-03-10 0:55 ` [Qemu-devel] [PATCH v5 05/14] qapi: Emit implicit structs in generated C Eric Blake
2016-03-10 14:25 ` Markus Armbruster
2016-03-10 0:55 ` [Qemu-devel] [PATCH v5 06/14] qapi-event: Slightly shrink generated code Eric Blake
2016-03-10 18:50 ` Markus Armbruster
2016-03-10 20:14 ` Eric Blake
2016-03-16 14:41 ` Markus Armbruster
2016-03-10 0:55 ` [Qemu-devel] [PATCH v5 07/14] qapi: Utilize implicit struct visits Eric Blake
2016-03-10 19:05 ` Markus Armbruster
2016-03-10 20:16 ` Eric Blake [this message]
2016-03-16 14:45 ` Markus Armbruster
2016-03-10 0:55 ` [Qemu-devel] [PATCH v5 08/14] qapi-commands: Inline single-use helpers of gen_marshal() Eric Blake
2016-03-10 0:55 ` [Qemu-devel] [PATCH v5 09/14] qapi: Inline gen_visit_members() into lone caller Eric Blake
2016-03-10 0:55 ` [Qemu-devel] [PATCH v5 10/14] qapi: Drop unused c_null() Eric Blake
2016-03-10 0:55 ` [Qemu-devel] [PATCH v5 11/14] qapi: Don't special-case simple union wrappers Eric Blake
2016-03-10 0:55 ` [Qemu-devel] [PATCH v5 12/14] qapi: Make BlockdevOptions doc example closer to reality Eric Blake
2016-03-10 0:55 ` [Qemu-devel] [PATCH v5 13/14] qapi: Allow anonymous base for flat union Eric Blake
2016-03-10 20:22 ` Markus Armbruster
2016-03-10 20:50 ` Eric Blake
2016-03-16 15:21 ` Markus Armbruster
2016-03-10 0:55 ` [Qemu-devel] [PATCH v5 14/14] qapi: Use anonymous bases in QMP flat unions Eric Blake
2016-03-10 20:36 ` [Qemu-devel] [PATCH v5 00/14] easier unboxed visits/qapi implicit types Markus Armbruster
2016-03-16 15:24 ` Markus Armbruster
2016-03-17 15:36 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56E1D633.8030400@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).