From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ae70z-0000j0-N5 for qemu-devel@nongnu.org; Thu, 10 Mar 2016 15:16:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ae70v-0005yv-7k for qemu-devel@nongnu.org; Thu, 10 Mar 2016 15:16:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ae70u-0005yr-W0 for qemu-devel@nongnu.org; Thu, 10 Mar 2016 15:16:53 -0500 References: <1457571335-10938-1-git-send-email-eblake@redhat.com> <1457571335-10938-8-git-send-email-eblake@redhat.com> <87r3fip2zx.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <56E1D633.8030400@redhat.com> Date: Thu, 10 Mar 2016 13:16:51 -0700 MIME-Version: 1.0 In-Reply-To: <87r3fip2zx.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sGgqDDLBJ6F2QlT2KdtEtDMC8uS22AFQs" Subject: Re: [Qemu-devel] [PATCH v5 07/14] qapi: Utilize implicit struct visits List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sGgqDDLBJ6F2QlT2KdtEtDMC8uS22AFQs Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/10/2016 12:05 PM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> 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 =3D {0}; >=20 > Let's calls this arg. Sure. >=20 >> |+ >> |+ v =3D qmp_input_get_visitor(qiv); >> |+ visit_type_q_obj_add_fd_arg_members(v, &qapi, &err); >> |+ if (err) { >> |+ goto out; >> | } >> | >> |- retval =3D qmp_add_fd(has_fdset_id, fdset_id, has_opaque, opaque= , &err); >> |+ retval =3D 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=3Dgen_event_send_proto(name, arg_type)) >> @@ -50,6 +74,7 @@ def gen_event_send(name, arg_type): >> QmpOutputVisitor *qov; >> Visitor *v; >> ''') >> + ret +=3D gen_param_var(arg_type) >> >> ret +=3D 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --sGgqDDLBJ6F2QlT2KdtEtDMC8uS22AFQs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW4dYzAAoJEKeha0olJ0NqksoH/A6JbD4tvp/bou1rgQB/SASk rGPUE2ReqOVESWpmmD3qX3rDb/TMKometKoILtCaByg6EbIcR/d6iUbzXvZHAL1E 2EkxrbdC1Csm6weEhSOIqgVew+az6k2Kg1mtSIPOUFfbM2E7NQWseoc3Z6N/adcO erMCoFgCpOWJ+0fU6KSBu3dr//FaSVSQCJijYXxHEbquM0LPz0mjEMLV9dLn+7w8 2Sz5uEtzyIbYQBVics+4L0YoeS2qtnt0NjZDJqzVAvIgrp561AWViynTnAMe1GGb E6RDQACYcmui7yPFZPb+hLQSJ4SdZbZ5dxsDW4tFM1OPgIab8l6cR9Am0+Yp2NE= =onfA -----END PGP SIGNATURE----- --sGgqDDLBJ6F2QlT2KdtEtDMC8uS22AFQs--