From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYDNa-0001qr-2W for qemu-devel@nongnu.org; Sat, 05 Sep 2015 09:19:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYDNW-0004ox-3i for qemu-devel@nongnu.org; Sat, 05 Sep 2015 09:19:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYDNV-0004oq-TB for qemu-devel@nongnu.org; Sat, 05 Sep 2015 09:19:34 -0400 References: <878u8mb62t.fsf@blackfin.pond.sub.org> <1441410668-25265-1-git-send-email-eblake@redhat.com> From: Eric Blake Message-ID: <55EAEBDF.5070704@redhat.com> Date: Sat, 5 Sep 2015 07:19:27 -0600 MIME-Version: 1.0 In-Reply-To: <1441410668-25265-1-git-send-email-eblake@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9cnfA76G9NFLtFILji5MSLCHf6SDPQewG" Subject: Re: [Qemu-devel] [PATCH RFC v4 02.5/32] qapi: Hide internal data members of schema objects. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: armbru@redhat.com, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9cnfA76G9NFLtFILji5MSLCHf6SDPQewG Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/04/2015 05:51 PM, Eric Blake wrote: > We have a few fields that exist mainly to hold information from > __init__() until check() (matching the fact that parsing is > two-pass; the first to find type names, the second to associate > types together while honoring forward references), or which should > only be used through accessor methods. We should not use these > fields directly in other files after check() has run, so use the > python convention of naming these fields with leading underscore > to mark their internal usage, and to check that no one else was > using them. >=20 > Exception: our crazy handling of simple unions (with a C member > 'kind' matching the QMP wire 'type') requires peeking through > the hidden field. This leaky abstraction will be cleaned up in > a later patch. >=20 > Signed-off-by: Eric Blake > --- >=20 > Technically, I wrote this patch after 32; if you decide to rebase > it into the series, you'll have to split it among 2, 10, 11, and 30. > Up to you if you want to squash this in during your spin of v5, or > if you want me to keep it as a separate patch for inclusion after > your series. Oh, and tests/qapi-schema/test-qapi.py is annoying - even when it exits non-zero, it does NOT cause a failure in 'make check-qapi-schema'. You'll need to additionally consider squashing this in to 5: diff --git i/tests/qapi-schema/test-qapi.py w/tests/qapi-schema/test-qapi= =2Epy index 471f8e1..0fc0622 100644 --- i/tests/qapi-schema/test-qapi.py +++ w/tests/qapi-schema/test-qapi.py @@ -40,8 +40,9 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor): @staticmethod def _print_variants(variants): if variants: - if variants.tag_name: - print ' tag %s' % variants.tag_name + # TODO: fix simple unions so we don't have to look at _tag_n= ame + if variants._tag_name: + print ' tag %s' % variants.tag_member.name for v in variants.variants: print ' case %s: %s' % (v.name, v.type.name) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --9cnfA76G9NFLtFILji5MSLCHf6SDPQewG 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/ iQEcBAEBCAAGBQJV6uvfAAoJEKeha0olJ0NqJW0H/3PKI2bBVPYm1CUriVNGGK8a Jp7t9ruQELQCOn+GEsLBygNH3b2T2Zrn/U1L5v9m/sYGZmHoPYBO5c1G3YpR+2Gl 4wQHE5ZowA1WIR2BTq4P9ROpx5tk38cgPHNtUlgWix8x1LONWPm7hipto7AX325O mAkxjO0loH4ybzylzpDQ9IbggM9IP1R8iIDCF7dquqI5CYMaDhiM9Pp5NHZlZvsK NkGFti6Y/Fzr8Q8NO2PFcJAI7+X4jjYclFi1d6+GVx/yIUmCVar8hjZk840g+0rB 4eaWj2pIxg4/mYqwYt9sbuYij/MwbW5ZQozjjeCuppktb76Gwam9msWi9PeJwMQ= =gZLu -----END PGP SIGNATURE----- --9cnfA76G9NFLtFILji5MSLCHf6SDPQewG--