From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLwMW-0001pc-Ef for qemu-devel@nongnu.org; Wed, 20 Jan 2016 12:16:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLwMT-0001v2-5f for qemu-devel@nongnu.org; Wed, 20 Jan 2016 12:16:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36185) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLwMT-0001uy-0X for qemu-devel@nongnu.org; Wed, 20 Jan 2016 12:16:01 -0500 References: <1453219845-30939-1-git-send-email-eblake@redhat.com> <1453219845-30939-9-git-send-email-eblake@redhat.com> <87k2n4p79t.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <569FC0CF.3040304@redhat.com> Date: Wed, 20 Jan 2016 10:15:59 -0700 MIME-Version: 1.0 In-Reply-To: <87k2n4p79t.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="eGfgxRqoEJLv7eMuU1LHop0DO4nqAncmx" Subject: Re: [Qemu-devel] [PATCH v9 08/37] qapi: Track all failures between visit_start/stop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: marcandre.lureau@redhat.com, qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --eGfgxRqoEJLv7eMuU1LHop0DO4nqAncmx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/20/2016 09:03 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> Inside the generated code between visit_start_struct() and >> visit_end_struct(), we were blindly setting the error into >> the caller's errp parameter. But a future patch to split >> visit_end_struct() will require that we take action based >> on whether an error has occurred, which requires us to track >> all actions through a local err. Rewrite the visits to be >> more in line with the other generated calls. >> >> |+ if (!*obj) { >=20 > err is clear here. >=20 >> |+ goto out_obj; >> |+ } >> |+ visit_type_GuestAgentCommandInfo_fields(v, obj, &err); >> |+out_obj: >> |+ error_propagate(errp, err); >> |+ err =3D NULL; >=20 > If we come from goto out_obj, these two lines are no-ops. I could move the label, if desired... >=20 >> |+ visit_end_struct(v, &err); >> |+out: >> | error_propagate(errp, err); >> | } >=20 > gen_visit_union(), the other generator of visit_start_struct(), already= > does it this way. It generates additional goto out_obj, so the > placement of out_obj makes more sense there. I guess we want to place > it in the same spot here to facilitate unifying the two. =2E..but as you observed, the unification in 31 is a bit easier with it placed identically. Maybe a commit message comment is in order. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --eGfgxRqoEJLv7eMuU1LHop0DO4nqAncmx 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/ iQEcBAEBCAAGBQJWn8DPAAoJEKeha0olJ0NqyZMH/AzW9bnEMImW2HPzfZt+yaHB l2dh14AWd54aZqAuuGTngtwFNxrTvgEaBAotQNA0CRokQpGWBzAL+sP8g4slFQqs ufxqZfBoGPrw+Qsev3oictqJqKLdVUp12h0t+vOTIcJSUtZquo7lpC1fO41Y8svp cg0AGlV1hidYsTXFBamkbr9YYId0DSYWUTbBTlxSvJdHXuvOB6h1pq/VDo2+FNRr b3cYUdbBuELUYwtYS7vozhUnZqF0Z3JfDoKeAWRsNhHdruPin/DztpUv/Fv+AXFs ef/j6BzBIy7Je0K2djW+h6Pw1U2N5wdU6hrAAdcj/QRXmma2is5/nLx7J6FClWU= =O7Pp -----END PGP SIGNATURE----- --eGfgxRqoEJLv7eMuU1LHop0DO4nqAncmx--