From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3tWi-0007Bn-TX for qemu-devel@nongnu.org; Tue, 01 Dec 2015 17:36:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3tWe-0000LI-RX for qemu-devel@nongnu.org; Tue, 01 Dec 2015 17:36:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3tWe-0000LC-Ks for qemu-devel@nongnu.org; Tue, 01 Dec 2015 17:35:56 -0500 References: <1448040300-968-1-git-send-email-eblake@redhat.com> <1448040300-968-13-git-send-email-eblake@redhat.com> <87h9k7byqi.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <565E20C5.804@redhat.com> Date: Tue, 1 Dec 2015 15:35:49 -0700 MIME-Version: 1.0 In-Reply-To: <87h9k7byqi.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UNAvPrhbWw0sXVlU5Ke3PX7Vo0ddflpHg" Subject: Re: [Qemu-devel] [PATCH v13 12/14] qapi: Enforce (or whitelist) case conventions on qapi members 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) --UNAvPrhbWw0sXVlU5Ke3PX7Vo0ddflpHg Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/27/2015 02:03 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> We document that members of enums and objects should be >> 'lower-case', although we were not enforcing it. We have to >> whitelist a few pre-existing entities that violate the norms. >> Add three new tests to expose the new error message, each of >> which first uses the whitelisted name 'UuidInfo' to prove the >> whitelist works, then triggers the failure. >=20 >> + 'X86CPURegister32', >=20 > Because of all enum members. >=20 > *Not* visible in QMP, thus fixable. Fix or TODO comment, please. Not visible directly in QMP, but unfortunately visible in QOM. See target-i386/cpu.c, where x86_reg_info_32[] references the all-caps names, and where x86_cpu_get_feature_words() calls visit_type_X86CPUFeatureWordInfoList() and thereby exposes X86CPURegister32 to the caller through 'qom-get'. I can certainly add comments, though. >> +++ b/tests/qapi-schema/args-member-case.json >> @@ -0,0 +1,3 @@ >> +# Member names should be 'lower-case' unless the struct/command is wh= itelisted >> +{ 'command': 'UuidInfo', 'data': { 'Arg': 'int' } } >> +{ 'command': 'Foo', 'data': { 'Arg': 'int' } } >=20 > We normally put positive tests in qapi-schema-test.json, but I think > keeping this one here makes more sense. The idea of a positive test prior to a negative test, in order to prove that the .err file refers only to the line number of the negative test, was copied from returns-whitelist.json. But maybe I can reuse the 'no-way-this-will-get-whitelisted' name from that test :) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --UNAvPrhbWw0sXVlU5Ke3PX7Vo0ddflpHg 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/ iQEcBAEBCAAGBQJWXiDFAAoJEKeha0olJ0Nq3O4H/A54kYRhA0hO19PTxDptByEP o7okgji6pEvLbBuJ4pNBImtLfKNY1fuiKq3vQEsjhw4npOnaU/jOg8tp16l2hQ3L wRf6hvX6aGIp/cWmbyknfHEckSflnJHQSx6m+MWU03wDqo3qRAuX5tt5VDtEZyX9 SJQthGKZpWgEqd9g7esjMbAaBsSVcPs9NBvoq9N0GjttP1hloiscxvpEG4/43ls7 sfVCqIElfk3Yd/wzFfGerEyUeR2GJ3qmB+jcUBNtzl+Tdf2y/+oVQGwNYob0XJjq qQUUTX6R76p4QpwtdpBCECAE5NlLED4KCT4mGVY5ea0/PzOwrxynKGKK3wgtxmE= =QZmr -----END PGP SIGNATURE----- --UNAvPrhbWw0sXVlU5Ke3PX7Vo0ddflpHg--