From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6EDm-0001KX-Uw for qemu-devel@nongnu.org; Tue, 08 Dec 2015 04:06:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6EDg-0006wg-U6 for qemu-devel@nongnu.org; Tue, 08 Dec 2015 04:06:06 -0500 Date: Tue, 8 Dec 2015 15:42:10 +1100 From: David Gibson Message-ID: <20151208044210.GN20139@voom.fritz.box> References: <1449546921-6378-1-git-send-email-eblake@redhat.com> <1449546921-6378-29-git-send-email-eblake@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ie5iOtK4e9kgqh2F" Content-Disposition: inline In-Reply-To: <1449546921-6378-29-git-send-email-eblake@redhat.com> Subject: Re: [Qemu-devel] [PATCH v7 28/31] qapi: Split visit_end_struct() into pieces List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: "Michael S. Tsirkin" , qemu-devel@nongnu.org, armbru@redhat.com, Michael Roth , Alexander Graf , "open list:sPAPR (pseries)" , Paolo Bonzini , Luiz Capitulino , Andreas =?iso-8859-1?Q?F=E4rber?= --Ie5iOtK4e9kgqh2F Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 07, 2015 at 08:55:18PM -0700, Eric Blake wrote: > As mentioned in previous patches, we want to call visit_end_struct() > functions unconditionally, so that visitors can release resources > tied up since the matching visit_start_struct() without also having > to worry about error priority if more than one error occurs. >=20 > Even though error_propagate() can be safely used to ignore a second > error during cleanup caused by a first error, it is simpler if the > cleanup cannot set an error, and we instead split the task of > checking that an input visitor has no unvisited input as a new > function visit_check_struct(), called only if all prior steps are > successful. >=20 > Generated code has diffs resembling: >=20 > |@@ -59,10 +59,12 @@ void visit_type_ACPIOSTInfo(Visitor *v, > | goto out_obj; > | } > | visit_type_ACPIOSTInfo_fields(v, obj, &err); > |+ if (err) { > |+ goto out_obj; > |+ } > |+ visit_check_struct(v, &err); > | out_obj: > |- error_propagate(errp, err); > |- err =3D NULL; > |- visit_end_struct(v, &err); > |+ visit_end_struct(v); > | out: >=20 > Signed-off-by: Eric Blake For spapr parts: Acked-by: David Gibson --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --Ie5iOtK4e9kgqh2F Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWZl+iAAoJEGw4ysog2bOSOOUP/iqnrmzpgBr6k8dEnxQutN9R xX1N5vVK3MR6dGls0wzcij4Xi01n2m7yd1s35xOEmCryWdrmnIUjQRtsl7oAiA7w KWPpB7B5RDygyWIaKzddPchD+60Fy4/or3fQq7uz0S9hOIBKi/tRZ0OJEp6qUpeg wo1VPnb3PhRAut0upqhL2EJSK7LFIEdCksLnjF8nDQFEivFkFtfOu5i74KA6rcVs GU2OC7H88bgZOjXpnnlgeUtFIFICMKkIF+D9wk32kJihUXE1sp5mwaoDgKeT1GeN lOIg6ObNTU408OO53YWAJm7HtnCFdY2+mY7cWtFUY0gg3bFwHqVndkJB68dEfMCB cNhDxeg9ev4b3wDHkdt3eqpGtApUUNbRFvIT4NnZUlnKGSdJcvV1Ah/UYGRNUgmw JLMl/cRJJxYmpecHTEeKwnmGAjDB/bI04KUmBn2WTYFHtZ87xcQfCkV5V0P+eMv8 YKjjTf/ZOnXwlBgfygeDg4EacDmqM+2kY/l8cHYBlzhOfGAMSRxa9RPzDQtPUWRJ Y+vLc/xJsIlqZnSf9Jq8S0YpRz2qaUIhLK7yWRIILchDeOBcUE+DtxFZs9lvR1xM LGY1Vmh8BqNmXdHrD4yWK0F2c0kF9dlM6k6UVI5njZ1U2lFck0hg6StbH1dyNCTb KZBZvfHDo2m9p2+ApSmg =6I9r -----END PGP SIGNATURE----- --Ie5iOtK4e9kgqh2F--