From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGU0G-0003oz-GY for qemu-devel@nongnu.org; Tue, 05 Jan 2016 10:58:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGU0D-0001Xl-Aj for qemu-devel@nongnu.org; Tue, 05 Jan 2016 10:58:32 -0500 References: <1450717720-9627-1-git-send-email-eblake@redhat.com> <1450717720-9627-19-git-send-email-eblake@redhat.com> From: Eric Blake Message-ID: <568BE822.4060703@redhat.com> Date: Tue, 5 Jan 2016 08:58:26 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="FWKLwvXnjVQR1r9995MCFIAjT6V34EXsx" Subject: Re: [Qemu-devel] [PATCH v8 18/35] qapi: Drop unused error argument for list and implicit struct List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= Cc: Michael Roth , Markus Armbruster , Alexander Graf , QEMU , "open list:sPAPR pseries" , David Gibson This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --FWKLwvXnjVQR1r9995MCFIAjT6V34EXsx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/05/2016 07:05 AM, Marc-Andr=C3=A9 Lureau wrote: > Hi >=20 > On Mon, Dec 21, 2015 at 6:08 PM, Eric Blake wrote: >> No backend was setting an error when ending the visit of a list >> or implicit struct. Make the callers a bit easier to follow by >> making this a part of the contract, and removing the errp >> argument - callers can then unconditionally end an object as >> part of cleanup without having to think about whether a second >> error is dominated by a first, because there is no second error. >> >> A later patch will then tackle the larger task of splitting >> visit_end_struct(), which can indeed set an error. >> >> Signed-off-by: Eric Blake >> >=20 > This patch makes visit_end_list() possibly abort, while before it > would pass the error to upper. Not so. The only added use of &error_abort is... > I assume that's what you are going to > change next. >=20 > Reviewed-by: Marc-Andr=C3=A9 Lureau >=20 >> +++ b/qapi/qmp-input-visitor.c >> @@ -153,10 +153,6 @@ static void qmp_input_start_implicit_struct(Visit= or *v, void **obj, >> } >> } >> >> -static void qmp_input_end_implicit_struct(Visitor *v, Error **errp) >> -{ >> -} >> - >> static void qmp_input_start_list(Visitor *v, const char *name, Error = **errp) >> { >> QmpInputVisitor *qiv =3D to_qiv(v); >> @@ -201,11 +197,11 @@ static GenericList *qmp_input_next_list(Visitor = *v, GenericList **list, >> return entry; >> } >> >> -static void qmp_input_end_list(Visitor *v, Error **errp) >> +static void qmp_input_end_list(Visitor *v) >> { >> QmpInputVisitor *qiv =3D to_qiv(v); >> >> - qmp_input_pop(qiv, errp); >> + qmp_input_pop(qiv, &error_abort); =2E..here; but the only time that qmp_input_pop() sets error is if it is paired with a qmp_input_push() from a struct, not a list. It is a true programming bug if you can mismatch push(struct)/pop(list) or push(list)/pop(struct), which deserves to abort, and which is not triggerable in the current code base. But you are correct that later patches then further clean up qmp-input-visitor.c. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --FWKLwvXnjVQR1r9995MCFIAjT6V34EXsx 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/ iQEcBAEBCAAGBQJWi+giAAoJEKeha0olJ0Nq8jYIAIjJXv/r0ZmbadcbLk3Ih4s/ e7dzCYndB7ZLlJW3Weq1m8tsajYID4zI40o/4D6QiRGub+xXp8TFps4M7Lq+ka6E mkY0ydnav8SYKU6YAvH2HX+8w90/+ZqkMuH0RZZ30FCdwNM3jLpoIYlOOOkwUx7z 2Z3lB5wl/aDLyYKgZ2oGedeBJ8TQ2jOlLNMMJ57LMyL4/lcT9i1UZOqMH6r8+Ke7 A1uqBeURLjMV3Kzo/r20iMPUhF1zKGcxPwsiUC6LIrLFMYL7gp+ojoo+UXJTgQ/w qXliYp912BLlZ8XjztKNjaHXFpvIFgBra6zDBaz0uzjoXv/me6ZMNlzZ2vxmXTk= =99aO -----END PGP SIGNATURE----- --FWKLwvXnjVQR1r9995MCFIAjT6V34EXsx--