From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlzGQ-0000lu-1U for qemu-devel@nongnu.org; Tue, 13 Oct 2015 09:05:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlzGO-00062Y-Sz for qemu-devel@nongnu.org; Tue, 13 Oct 2015 09:05:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlzGO-00062B-DI for qemu-devel@nongnu.org; Tue, 13 Oct 2015 09:05:08 -0400 References: <1444710158-8723-1-git-send-email-eblake@redhat.com> <1444710158-8723-8-git-send-email-eblake@redhat.com> <87lhb7808o.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <561D017E.6030107@redhat.com> Date: Tue, 13 Oct 2015 07:05:02 -0600 MIME-Version: 1.0 In-Reply-To: <87lhb7808o.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jIAs5F3x1uvFCpx50wHnK30Bm9InwtxHT" Subject: Re: [Qemu-devel] [PATCH v8 07/18] qapi: Don't use info as witness of implicit object type 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) --jIAs5F3x1uvFCpx50wHnK30Bm9InwtxHT Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/13/2015 05:40 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> @@ -900,6 +903,10 @@ 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) >> >=20 > I believe this method... >=20 >> @@ -970,12 +977,16 @@ 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 ':' >> + >=20 > ... as well as this one are redundant at this stage. They become > necessary only when you start passing info !=3D None to the constructor= in > PATCH 12. If I'm right, then moving the two to PATCH 12 makes sense. I think you're right; we could float these hunks to where they become important if there is a reason for a respin. >> def _make_implicit_enum_type(self, name, values): >> - name =3D name + 'Kind' >> + name =3D name + 'Kind' # Use namespace reserved by add_name= () >=20 > This is the comment I suggested... >=20 >> self._def_entity(QAPISchemaEnumType(name, None, values, None)= ) >> return name >> >> def _make_array_type(self, element_type): >> + # TODO fooList namespace is not reserved; user can create col= lisions, >> + # or abuse our type system with ['fooList'] for 2D array >=20 > ... and this is its buddy you added on your own initiative. Thanks! >=20 > Did you actually try the abuse? If not, I'd say "or maybe abuse", out > of caution. Yes, back in an earlier version of your introspection work, we played with 2D arrays, and concluded that it wasn't worth worrying about until the queue is flushed: https://lists.gnu.org/archive/html/qemu-devel/2015-08/msg00551.html But back then, when I was playing with it, I did confirm that ['fooList'] gets past the generator. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --jIAs5F3x1uvFCpx50wHnK30Bm9InwtxHT 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/ iQEcBAEBCAAGBQJWHQF+AAoJEKeha0olJ0NqwGgIAJoze7x+axw/raPCpIE10FtF Hn6ouAfytu0iQ11dO4rCiiaSCP8+zCwjo0ceGCj+6qAeu6NtqbTbFS0OpN80PcsL vzQYsJ3WFcePzWuvdZxmFh5+0A5AqRxnc7b79S1S5nrk+qG8MIqnWb1BfoK/PHLB U5QqFV63yXNkGoMuAY4WRPkKEQklKtW1rWFjjNDIbRwcFrxXaq0XPpSAo54qzH3B rvr5hPEVtLYDr8StTXtIlI3fAdHGwYm/1KLuFUAJMELPvA3oMSCxwacXQlClq3pF DhTZah0nR4tqXbrCZDTZAEfmjbzJLMsMX1Lm5VcGJh3Balj1g7L/0oAbXeAWyes= =sSJL -----END PGP SIGNATURE----- --jIAs5F3x1uvFCpx50wHnK30Bm9InwtxHT--