From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZobOa-0003fI-Bs for qemu-devel@nongnu.org; Tue, 20 Oct 2015 14:12:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZobOX-0001hL-6X for qemu-devel@nongnu.org; Tue, 20 Oct 2015 14:12:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42315) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZobOW-0001hH-Va for qemu-devel@nongnu.org; Tue, 20 Oct 2015 14:12:21 -0400 References: <1444968943-11254-1-git-send-email-eblake@redhat.com> <1444968943-11254-3-git-send-email-eblake@redhat.com> <87oafun8cd.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <562683FF.2090100@redhat.com> Date: Tue, 20 Oct 2015 12:12:15 -0600 MIME-Version: 1.0 In-Reply-To: <87oafun8cd.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Dr9DWUSkCHfuOahsXb21d1EWLKH6PO0Rs" Subject: Re: [Qemu-devel] [PATCH v9 02/17] qapi: Reserve '*List' type names for arrays 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) --Dr9DWUSkCHfuOahsXb21d1EWLKH6PO0Rs Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/19/2015 10:14 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> We already reserved '*Kind' for implicit enums (since commit >=20 > "We reserved '*Kind' since" sounds odd. Present tense? >=20 >> 4dc2e69), but failed to reserve '*List' for array types. Since >> no QMP was yet using it, we might as well make the reservation >> official. >=20 > Uhm, how can we fail to reserve something, and then make the reservatio= n > official? I think what you're trying to say is something like >=20 > Type names ending in 'List' can clash with array types in generated= > C. We don't currently use such names. Outlaw them. >=20 > Precedence: commit 4dc2e69 outlawed names ending in 'Kind', because= > they can clash with implicit enum types of unions. >=20 Okay, your wording has some improvements. I'll take those ideas and try again. >> Note that this forbids creation of new types or commands ending >> in 'List', but does NOT forbid abuse of attempts like ['intList'] >> for creating a 2-dimensional array of 'int'. >=20 > Really? If I write ['T'], then T must be a declared type, mustn't it? > And after this patch, I cant declare type intList, can I? You can't declare { 'struct': 'intList' }, but I was worried whether you can abuse the type system by using { 'struct':'S', 'data': { 'two-d':['intList'] } }. But I guess I should actually test things rather than trying to mis-remember past conversations; a quick test shows= : /home/eblake/qemu/tests/qapi-schema/qapi-schema-test.json:10: Member 'two-d' of 'data' for struct 'S' uses unknown type 'intList' so what we were experimenting with earlier was [['int']] and not ['intList']. I'll update the paragraph accordingly. >=20 >> The whole idea of >> multi-dimensional arrays needs more design thought, best left for >> another day. >> >> Signed-off-by: Eric Blake >=20 > Patch looks good to me. >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Dr9DWUSkCHfuOahsXb21d1EWLKH6PO0Rs 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/ iQEcBAEBCAAGBQJWJoP/AAoJEKeha0olJ0NqDBcH+wQXAMrGYTl1m5AEveOUUBjt h/0MPfw+UhOS0wr38gmUtYIWAG5+hzrt1/oj9Rf9giXPANGAJ/UtSAOrqPGfhF46 Mbw/PwTKhyLw4d7CrA99BN2ghJKn11S5UTFUAj9bxq/3ofxUcR2NhDwkCoPanzNB 2j+WFZGL18osj3yY8ZHQFZDpMWDeMxKYyaDTu7NIH64F/zrI6ITjex+H/mVsG+FC qlqRrcbMvC2wxklHTscqYwKfMF3pX6S9ld7YlTowAoWtYOxCGckaKt5SXcH7W1UM q+YuZYkeWPlbSWQcsCOepqGsCzdQB/3KcfkrDgMmpXLBvj+tXlibGKzsi0FjH34= =XzKn -----END PGP SIGNATURE----- --Dr9DWUSkCHfuOahsXb21d1EWLKH6PO0Rs--