From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zm60r-00056j-8Q for qemu-devel@nongnu.org; Tue, 13 Oct 2015 16:17:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zm60o-0002ux-2B for qemu-devel@nongnu.org; Tue, 13 Oct 2015 16:17:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zm60n-0002uL-QX for qemu-devel@nongnu.org; Tue, 13 Oct 2015 16:17:29 -0400 References: <1444710158-8723-1-git-send-email-eblake@redhat.com> <1444710158-8723-16-git-send-email-eblake@redhat.com> <87zizm6c67.fsf@blackfin.pond.sub.org> <561D24CA.7030804@redhat.com> <87mvvmvghf.fsf@blackfin.pond.sub.org> <561D42C3.1050207@redhat.com> <87wpuqmxex.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <561D66D3.5090500@redhat.com> Date: Tue, 13 Oct 2015 14:17:23 -0600 MIME-Version: 1.0 In-Reply-To: <87wpuqmxex.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6HGKN70gpP7jHxAPP2U6JWjcPId67qpdq" Subject: Re: [Qemu-devel] [PATCH v8 15/18] qapi: Move duplicate member checks to schema check() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6HGKN70gpP7jHxAPP2U6JWjcPId67qpdq Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/13/2015 12:32 PM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> On 10/13/2015 11:13 AM, Markus Armbruster wrote: >> >>>>> >>>>> I've come to the conclusion that we should get rid of the self-infl= icted >>>>> pain before we attempt to detect all collisions. >>>> >>>> Then that sounds like I should try harder to get the kind/type namin= g, >>>> the boxed base naming, and even the anonymous union naming all hoist= ed >>>> into this subset, and spin a v9? >>> >>> I can take PATCH 01-09,12 into my tree right away, with PATCH 07's tw= o >>> redundant is_implicit() methods dropped, and PATCH 12's comment touch= ed >>> up. >> >> Okay. >=20 > Done & pushed to http://repo.or.cz/qemu/armbru.git branch qapi-next. I didn't see any mentioned changes on patch 7, at least not in commit 4ad5066. Last paragraph of the commit message would also need a massage, if you do want to squash it in: Instead, add an is_implicit() method to QAPISchemaEntity, and use it. It can be overridden later for ObjectType and EnumType, when implicit instances of those classes gain info. diff --git a/scripts/qapi.py b/scripts/qapi.py index e263ecf..d7cf0f3 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -903,10 +903,6 @@ class QAPISchemaEnumType(QAPISchemaType): def check(self, schema): assert len(set(self.values)) =3D=3D len(self.values) - def is_implicit(self): - # See QAPISchema._make_implicit_enum_type() - return self.name[-4:] =3D=3D 'Kind' - def c_type(self, is_param=3DFalse): return c_name(self.name) @@ -977,10 +973,6 @@ class QAPISchemaObjectType(QAPISchemaType): self.variants.check(schema, members, seen) self.members =3D members - def is_implicit(self): - # See QAPISchema._make_implicit_object_type() - return self.name[0] =3D=3D ':' - def c_name(self): assert not self.is_implicit() return QAPISchemaType.c_name(self) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --6HGKN70gpP7jHxAPP2U6JWjcPId67qpdq 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/ iQEcBAEBCAAGBQJWHWbTAAoJEKeha0olJ0NquIAH/0C589lYdEr4x0RPt6oqra93 y/oUcvJQWoIlgtSPjMJsG68hF7/WX+h/F2I9Yynzm9IXeIEMPCKpxbpUlw+p6oyh Z1tQGIxUe/UZ1nfR2Bw5ZBdnEJ7uhJAeFieNI9mwGtTdXqs+kMtGZgKiZhYOKlEn o32bhrlY05h6Y9zTsHud+y404kXc9uVqYN4oGKmV8aLeL0gdB7gO1rFyHtip78xj RI2m2+DD8uEUE317jqsO6eKv7jKqnqiACklHgSeJsUl5EvAJIiW6+mVYUDfhadXl oX5tHzLxPStp7WkOqMA8ngGOr9mythyF7J8z6tOGCL4xgN3ZAAWRwIT2zaEydM8= =AR4o -----END PGP SIGNATURE----- --6HGKN70gpP7jHxAPP2U6JWjcPId67qpdq--