From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adMN3-000582-KO for qemu-devel@nongnu.org; Tue, 08 Mar 2016 13:28:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adMN0-0003Cd-8r for qemu-devel@nongnu.org; Tue, 08 Mar 2016 13:28:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adMN0-0003CZ-1k for qemu-devel@nongnu.org; Tue, 08 Mar 2016 13:28:34 -0500 References: <1457194595-16189-1-git-send-email-eblake@redhat.com> <1457194595-16189-6-git-send-email-eblake@redhat.com> <87d1r580q0.fsf@blackfin.pond.sub.org> <56DEF9CB.6020601@redhat.com> <87wppc3kpt.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <56DF19D0.4030504@redhat.com> Date: Tue, 8 Mar 2016 11:28:32 -0700 MIME-Version: 1.0 In-Reply-To: <87wppc3kpt.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="65LwA5mvMbm0CExrmnjux836uh44U4efa" Subject: Re: [Qemu-devel] [PATCH v4 05/10] 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) --65LwA5mvMbm0CExrmnjux836uh44U4efa Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/08/2016 11:09 AM, Markus Armbruster wrote: > This patch actually fixes a similar issue in the qmp_marshal_FOO() > functions. Indeed, and I didn't even realize it. I'll add that to the commit message= :) >=20 > To keep ignoring it in the qapi_event_send_BAR() functions is okay. > It's fairly easy to fix now, though: split them into two, so that the > outer half does nothing but parameter wrapping. For instance, >=20 > void qapi_event_send_block_io_error(const char *device, IoOperation= Type operation, BlockErrorAction action, bool has_nospace, bool nospace, = const char *reason, Error **errp) > { > QDict *qmp; > Error *err =3D NULL; > QMPEventFuncEmit emit; > QmpOutputVisitor *qov; > Visitor *v; > QObject *obj; > _obj_BLOCK_IO_ERROR_arg param =3D { > (char *)device, operation, action, has_nospace, nospace, (c= har *)reason > }; >=20 > [do stuff...] > } >=20 > becomes >=20 > static inline void do_event_send_block_io_error(_obj_BLOCK_IO_ERROR= _arg param, Error **errp) > { > QDict *qmp; > Error *err =3D NULL; > QMPEventFuncEmit emit; > QmpOutputVisitor *qov; > Visitor *v; > QObject *obj; >=20 > [do stuff...] > } >=20 > void qapi_event_send_block_io_error(const char *device, IoOperation= Type operation, BlockErrorAction action, bool has_nospace, bool nospace, = const char *reason, Error **errp) Still means we can't have 'errp' as a QMP member of the error, without some sort of renaming. Again, not worth worrying about until we actually want to avoid the collision. > { > do_event_send_block_io_error((_obj_BLOCK_IO_ERROR_arg){ > (char *)device, operation, action, has_nospace, nospace= , (char *)reason > }, errp); > }; > } >=20 > Feel free not to do that now, but mark the spot with a comment then. > Since it's technically wrong, we could even mark it FIXME. In fact, I have a patch in a later series [1] that WANTS to let the user supply a boxed parameter - at which point, the difference between two vs. one function would be whether the user requested boxing. Sounds like I add the FIXME here, and then that series can take care of the possible split. [1] https://lists.gnu.org/archive/html/qemu-devel/2015-12/msg04394.html --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --65LwA5mvMbm0CExrmnjux836uh44U4efa 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/ iQEcBAEBCAAGBQJW3xnQAAoJEKeha0olJ0NqJ2wH/0ooRST5Zj3I5HxnzIkPHTN/ 90dzEIVpEccxWK64Grud6eofpB6oi/4JPTjUGP8kAAMDqpY2OOTRyi2MTCCA2I6B mwB8ob6KW4Bypmj6uXLuc27zNDLNDxPKkeR3c0qoGBCC/jqRuXHtlyuspHYgRKxi Cr5pgqGXMdTVZe5IJepLT/kOvYRZqn+Y6YHvr4n+zJiFFzq1YbSZbcVgAd0W3B7w 5pUT7MqrxrfdwjZ6TQZQjvk/SqwEb563rkjNJ2hi4GsFMT3ZRK+DhZ3TgGv94UsN s/CRlyZoyKwns/c3PR2zNsxJhdmLnYAz4L01i7gKAFAYyNHKll7K5xpNrWOzEV8= =K7q0 -----END PGP SIGNATURE----- --65LwA5mvMbm0CExrmnjux836uh44U4efa--