From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOQgf-0006mz-Kf for qemu-devel@nongnu.org; Wed, 27 Jan 2016 09:03:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOQgW-0004z9-2T for qemu-devel@nongnu.org; Wed, 27 Jan 2016 09:03:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOQgV-0004z2-TR for qemu-devel@nongnu.org; Wed, 27 Jan 2016 09:03:00 -0500 References: <1453219845-30939-27-git-send-email-eblake@redhat.com> <1453902888-20457-1-git-send-email-armbru@redhat.com> <1453902888-20457-3-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <56A8CE12.6020508@redhat.com> Date: Wed, 27 Jan 2016 07:02:58 -0700 MIME-Version: 1.0 In-Reply-To: <1453902888-20457-3-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Xn3hphLSxGgNB1imkSSFqWlwSDBQfGMb1" Subject: Re: [Qemu-devel] [PATCH 2/3] qapi-visit: Clean up code generated around visit_end_union() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Xn3hphLSxGgNB1imkSSFqWlwSDBQfGMb1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/27/2016 06:54 AM, Markus Armbruster wrote: > The generated code can call visit_end_union() without having called > visit_start_union(). Example: >=20 > if (!*obj) { > goto out_obj; > } > visit_type_BlockdevOptions_fields(v, obj, &err); > if (err) { > goto out_obj; // if we go from here... > } > if (!visit_start_union(v, !!(*obj)->u.data, &err) || err) { > goto out_obj; > } > switch ((*obj)->driver) { > [...] > } > out_obj: > // ... then *obj is true, and ... > error_propagate(errp, err); > err =3D NULL; > if (*obj) { > // we end up here > visit_end_union(v, !!(*obj)->u.data, &err); > } > error_propagate(errp, err); >=20 > Harmless only because no visitor implements end_union(). Clean it up > anyway. I plan on deleting visit_end_union() anyways (and visit_start_union); see 32/37, plus the FIXME comments added in 21/37. Maybe it's easier to just delete this incorrect and unused callback earlier in the series, using your commit message as additional rationale why it is worthless, and leaving only visit_start_union() cleanups for 32/37. >=20 > Messed up since we have visit_end_union (commit cee2ded). Indeed. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Xn3hphLSxGgNB1imkSSFqWlwSDBQfGMb1 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/ iQEcBAEBCAAGBQJWqM4SAAoJEKeha0olJ0NqsRkIAI+pbVIG2l6Et/I/v4mX6VxK Rqwi9ocj+8WXySSxFmU0Mg6hV42mQqK8+HaOn4gMh1FagUHxdQ/119vBfK6RHgAa OGioU0mb6TXrRTlpeMK/iTeiQ8TSpNgG6qZQafY0ajbkuQd3jlEHgpNLg+AiNEot C9NMinQAnoL5JZZxxuE94Pr+1Li7d4fjDsrVPyzRkgWrMRRIevmWMt1b18edNn/h Su6ZTUN917iZi6f5+YqfJh/cQbI2GKZQdglRZthf3Id4UUQ3KIShzaX/F8tLw4yp HvSt8p25l0Uwgxqm3C0anM6xSrUlYo9jUw4+uVF0bHHIWVW0MLcCMm5lCyWOF2I= =N32B -----END PGP SIGNATURE----- --Xn3hphLSxGgNB1imkSSFqWlwSDBQfGMb1--