From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNnLb-0001Ac-Dj for qemu-devel@nongnu.org; Fri, 07 Aug 2015 15:30:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNnLY-00080p-7e for qemu-devel@nongnu.org; Fri, 07 Aug 2015 15:30:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNnLY-00080S-24 for qemu-devel@nongnu.org; Fri, 07 Aug 2015 15:30:28 -0400 References: <1438703896-12553-1-git-send-email-armbru@redhat.com> <1438703896-12553-27-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55C5074D.7050803@redhat.com> Date: Fri, 7 Aug 2015 13:30:21 -0600 MIME-Version: 1.0 In-Reply-To: <1438703896-12553-27-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9s73UTN9uPxrNOteLW6D6qKnONC4Qt3Qu" Subject: Re: [Qemu-devel] [PATCH RFC v3 26/32] qapi: Introduce a first class 'any' type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: kwolf@redhat.com, berto@igalia.com, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9s73UTN9uPxrNOteLW6D6qKnONC4Qt3Qu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/04/2015 09:58 AM, Markus Armbruster wrote: > It's first class, because unlike '**', it actually works, i.e. doesn't > require 'gen': false. >=20 > '**' will go away next. >=20 > Signed-off-by: Markus Armbruster > Reviewed-by: Eric Blake > --- > @@ -1039,8 +1040,7 @@ class QAPISchema(object): > =20 > def _def_builtin_type(self, name, json_type, c_type, c_null): > self._def_entity(QAPISchemaBuiltinType(name, json_type, c_type= , c_null)) > - if name !=3D '**': > - self._make_array_type(name) # TODO really needed? > + self._make_array_type(name) # TODO really needed? Do we really want to allow ['any'] in schemata? That would imply the possibility of a 2D array. > +++ b/tests/qapi-schema/qapi-schema-test.json > @@ -83,6 +83,8 @@ > 'returns': 'UserDefTwo' } > { 'command': 'user_def_cmd3', 'data': {'a': 'int', '*b': 'int' }, > 'returns': 'int' } > +# note: command name 'guest-sync' chosen to avoid "cannot use built-in= " error > +{ 'command': 'guest-sync', 'data': { 'arg': 'any' }, 'returns': 'any' = } > =20 In particular, if we DO want to allow it, this file should be enhanced to include ['any'] in the UserDefNativeListUnion. As it is, JSON allows mixed-type arrays, but all our uses of QList are fixed-type (all elements share the same type); allowing an array of any element may prove to be problematic. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --9s73UTN9uPxrNOteLW6D6qKnONC4Qt3Qu 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/ iQEcBAEBCAAGBQJVxQdNAAoJEKeha0olJ0Nqy+UH/3mLADDaEaOkKiLVfTdvT7sa PZ2I46gfVBjAQ9izx6ipG8q0/fBepdkl+IsRpMdcK7CiFGQyeP2AhtPb7Z+pR8mf GFXsaTU+NYgnzdavuPDqJglflu2YRuBCFB/gGjSETWoxGPds3N/LyfLdJEkfif3r vqzFPMfQld0wphtapaBKfXh4wIYxqrqHww+NkqR4NdDG1ZnqLe/8Fyj28nCSsYYG gDa86ipuTjW4omHFwkzIUs9nc4f2uVamCCPNJwNjdQr/FtIkLYAViG2qO0M91gnH x91H/kxnlraMCseSdnerw0PBeCG5y0i0F+W6ebvd46/RfedDOvKt0WsMe9XxExA= =7mlQ -----END PGP SIGNATURE----- --9s73UTN9uPxrNOteLW6D6qKnONC4Qt3Qu--