From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yba6d-0007H6-SN for qemu-devel@nongnu.org; Fri, 27 Mar 2015 15:39:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yba6a-0002OP-Ly for qemu-devel@nongnu.org; Fri, 27 Mar 2015 15:39:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yba6a-0002Mf-Ei for qemu-devel@nongnu.org; Fri, 27 Mar 2015 15:39:44 -0400 Message-ID: <5515B1FD.40703@redhat.com> Date: Fri, 27 Mar 2015 13:39:41 -0600 From: Eric Blake MIME-Version: 1.0 References: <1427227433-5030-1-git-send-email-eblake@redhat.com> <1427227433-5030-14-git-send-email-eblake@redhat.com> <87sicrzrau.fsf@blackfin.pond.sub.org> <551457B8.30005@redhat.com> <877fu2lioc.fsf@blackfin.pond.sub.org> In-Reply-To: <877fu2lioc.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xAw0mwwJDVCuqWVaKPbGwv2qU5grQT0h7" Subject: Re: [Qemu-devel] [PATCH v5 13/28] qapi: Add some expr tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, wenchaoqemu@gmail.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xAw0mwwJDVCuqWVaKPbGwv2qU5grQT0h7 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/27/2015 06:38 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> On 03/26/2015 09:55 AM, Markus Armbruster wrote: >>> Eric Blake writes: >>> >>>> Demonstrate that the qapi generator doesn't deal well with >>>> expressions that aren't up to par. Later patches will improve >>>> the expected results as the generator is made stricter. Only >>>> one of the added tests actually behaves sanely at rejecting >>>> obvious problems. >>>> >>> >>> qapi-code-gen.txt documents the naming conventions: >>> >>> Types, commands, and events share a common namespace. Therefore,= >>> generally speaking, type definitions should always use CamelCase = for >>> user-defined type names, while built-in types are lowercase. Type= >>> definitions should not end in 'Kind', as this namespace is used f= or >>> creating implicit C enums for visiting union types. Command name= s, >>> and field names within a type, should be all lower case with word= s >>> separated by a hyphen. However, some existing older commands and= >>> complex types use underscore; when extending such expressions, >>> consistency is preferred over blindly avoiding underscore. Event= >>> names should be ALL_CAPS with words separated by underscore. The= >>> special string '**' appears for some commands that manually perfo= rm >>> their own type checking rather than relying on the type-safe code= >>> produced by the qapi code generators. >>> >>> We should either enforce the conventions consistently, or not at all.= >>> >>> Enforcing them makes certain kinds of name clashes in generated C >>> impossible. If we don't enforce them, we should catch the clashes. >>> >>> Since I haven't read to the end of your series, I have to ask: do you= >>> intend to enforce them? >> >> I added tests to enforce it for event names, but did not enforce thing= s >> for command names or complex type members. I guess that can be added = on >> top, if desired. >> >> So, did this patch get R-b? >=20 > I'd rather not enforce naming conventions just for events. >=20 > If we want to enforce them, let's do it consistently, and in a separate= > series that includes this patch. Okay? Sounds like I need a v6 respin then, where I drop my patch that attempts to enforce all-caps event naming but did not enforce type or command naming; but I will keep everything else (enforcing that names are valid C identifiers + '-' and '.' (which both get flattened to '_'). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --xAw0mwwJDVCuqWVaKPbGwv2qU5grQT0h7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVFbH9AAoJEKeha0olJ0NqRT4H/jK82FThIB/c/FbEE1ltvuCQ 8fDj9Bybel5xpym2yuz8hoB4yMwc6poOrT7jU7JIiTozeaED//gjzWjTcTS0AUtC 1sHgFcscJJlHq4pxKSfn7i9Q+1GysXLLRo2BLV01UrCJq0BIRO0yuUi25pCC0gQA vni5Vf1npQWPi9wMs38R82Mz8h/cuXQJHVp2Y6P4ItUvA9fGw4VduLizKcknwFb/ /an6YvxVH5wzjRRWvZQk7k1nsg89m1AZMfnomJcZy0Zm6NFXxmkoq6hFvWoUtwQ6 nG0YS8Tfe6ZnoZTwBl/ZOM2M8PghFVLoBR/G5ndXb5xIGPDf5Y6nu90s/ztiN3k= =t8jl -----END PGP SIGNATURE----- --xAw0mwwJDVCuqWVaKPbGwv2qU5grQT0h7--