From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOvPm-0007JQ-QV for qemu-devel@nongnu.org; Thu, 28 Jan 2016 17:51:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOvPi-0004Tp-4H for qemu-devel@nongnu.org; Thu, 28 Jan 2016 17:51:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59577) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOvPh-0004Tl-UE for qemu-devel@nongnu.org; Thu, 28 Jan 2016 17:51:42 -0500 References: <1453219845-30939-1-git-send-email-eblake@redhat.com> <1453219845-30939-8-git-send-email-eblake@redhat.com> <87y4bks2g7.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <56AA9B7C.7080104@redhat.com> Date: Thu, 28 Jan 2016 15:51:40 -0700 MIME-Version: 1.0 In-Reply-To: <87y4bks2g7.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="b6PaAm2hEMtNnIjhV3lQ8xilIT5Ex1cVN" Subject: Re: [Qemu-devel] [PATCH v9 07/37] qapi: Improve generated event use of qapi visitor 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) --b6PaAm2hEMtNnIjhV3lQ8xilIT5Ex1cVN Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/20/2016 08:19 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> All other successful clients of visit_start_struct() were paired >> with an unconditional visit_end_struct(); but the generated >> code for events was relying on qmp_output_visitor_cleanup() to >> work on an incomplete visit. >=20 >> +++ b/scripts/qapi.py >> @@ -1636,7 +1636,8 @@ def gen_err_check(label=3D'out', skiperr=3DFalse= ): >> label=3Dlabel) >> >> >> -def gen_visit_fields(members, prefix=3D'', need_cast=3DFalse, skiperr= =3DFalse): >> +def gen_visit_fields(members, prefix=3D'', need_cast=3DFalse, skiperr= =3DFalse, >> + label=3D'out'): >=20 > Probably clearer than label=3DNone, but duplicates gen_err_check()'s > default. Fine with me. Use of label=3DNone resulted in literal "goto None;" in the generated fil= e (Python stringized it, rather than treating it as a hint to behave as if the argument were not supplied). So yes, I had to duplicate the default value in both methods, to avoid having to do 'if label:' within the implementations. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --b6PaAm2hEMtNnIjhV3lQ8xilIT5Ex1cVN 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/ iQEcBAEBCAAGBQJWqpt8AAoJEKeha0olJ0Nq/pQH/Rox5QmzU44rCzD5SAnaGITR vBHZiiOshqmX7FmEMxHGpTj59+EeLKXgzkIbmb5ddDwO8rQ+Qki+mtAffMuztVpm zFy6v+/qYqHoafbBf8sCyIX3hSJooEFLyx1N9JnKAJH7jyeyiVEdNtqNnXbxO5D0 MjqM1lrITVZAsyo+IEjrUPLzxmRnDdTJJUr24rUR6hE3e8/HUGUM6NvLg1Uw807I Qsv0mmemoamfyk/GSIkWH6NYTZzys4prs3mp94Ck5mI22GYE/+qOeU25BzJmRFP8 VQFohl/OLqg/rq6j0WSvNquXrwh3A/ujdKlNgbNifG8VhAwQwG7fOlD4O9C7JQ8= =mEHW -----END PGP SIGNATURE----- --b6PaAm2hEMtNnIjhV3lQ8xilIT5Ex1cVN--