From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwXxE-0005ad-E5 for qemu-devel@nongnu.org; Wed, 11 Nov 2015 11:09:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwXwD-00078R-JP for qemu-devel@nongnu.org; Wed, 11 Nov 2015 11:09:00 -0500 References: <1447224690-9743-1-git-send-email-eblake@redhat.com> <1447224690-9743-20-git-send-email-eblake@redhat.com> <87egfwbnfc.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <5643676E.8040502@redhat.com> Date: Wed, 11 Nov 2015 09:06:06 -0700 MIME-Version: 1.0 In-Reply-To: <87egfwbnfc.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="iXkUaDPpdUAot7O9i1kxuB9vtt3ljv4f5" Subject: Re: [Qemu-devel] [PATCH v11 19/28] qapi: Change munging of CamelCase enum values List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Kevin Wolf , Peter Maydell , "open list:Block layer core" , "Michael S. Tsirkin" , Jason Wang , qemu-devel@nongnu.org, Michael Roth , Gerd Hoffmann , Amit Shah , Luiz Capitulino , =?UTF-8?Q?Andreas_F=c3=a4rber?= This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --iXkUaDPpdUAot7O9i1kxuB9vtt3ljv4f5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/11/2015 07:50 AM, Markus Armbruster wrote: >> Thankfully, only two enums are affected: ErrorClass and InputButton. [Visiting just ErrorClass in this email] >=20 > By convention (see CODING_STYLE), we use CamelCase for type names, and > nothing else. >=20 > Only enums violating this naming convention can be affected. The bad > part: they exist. >=20 >=20 > ErrorClass's members are all camels. The C enumeration constants chang= e > as follows >=20 > ERROR_CLASS_GENERIC_ERROR ERROR_CLASS_GENERICERROR > ERROR_CLASS_COMMAND_NOT_FOUND ERROR_CLASS_COMMANDNOTFOUND > ERROR_CLASS_DEVICE_ENCRYPTED ERROR_CLASS_DEVICEENCRYPTED > ERROR_CLASS_DEVICE_NOT_ACTIVE ERROR_CLASS_DEVICENOTACTIVE > ERROR_CLASS_DEVICE_NOT_FOUND ERROR_CLASS_DEVICENOTFOUND > ERROR_CLASS_KVM_MISSING_CAP ERROR_CLASS_KVMMISSINGCAP >=20 > Again, not an improvement, but perhaps tolerabe, because these constant= s > aren't used much anymore: 55 occurences in 20 files. >=20 > If we find it not tolerable, we can manually add aliases: rename the > QAPI type out of the way, say 'QAPIErrorClass', then stick >=20 > typedef enum ErrorClass { > ERROR_CLASS_GENERIC_ERROR =3D QAPI_ERROR_CLASS_GENERICERROR, > ERROR_CLASS_COMMAND_NOT_FOUND =3D QAPI_ERROR_CLASS_COMMANDNOTFO= UND, > ERROR_CLASS_DEVICE_ENCRYPTED =3D QAPI_ERROR_CLASS_DEVICEENCRYPT= ED, > ERROR_CLASS_DEVICE_NOT_ACTIVE =3D QAPI_ERROR_CLASS_DEVICENOTACT= IVE, > ERROR_CLASS_DEVICE_NOT_FOUND =3D QAPI_ERROR_CLASS_DEVICENOTFOUN= D, > ERROR_CLASS_KVM_MISSING_CAP =3D QAPI_ERROR_CLASS_KVMMISSINGCAP,= > } ErrorClass; >=20 > into error.h with a suitable comment. Interesting hack. Certainly more legible, and I'm willing to attempt such a rename. As far as I'm concerned, though, this does not fix a bug, so much as make it easier for later qapi patches to be more robust. So any renaming we do is not under pressure to have to make it in by 2.5. We've got time to think about it. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --iXkUaDPpdUAot7O9i1kxuB9vtt3ljv4f5 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/ iQEcBAEBCAAGBQJWQ2duAAoJEKeha0olJ0NquHQH+walEJ9eZh7eYCyEmHbcG779 U9PKeN4obJ5AE6BXh+8fMUFD1/CFtWPJAqr+h6Xlkchl9iHm/7MAgNoV7HAlcmpi Q+7X28vTWr6TGZ+s+KlcKQqp8QXjVuaTC8JvKWFBoW94nhpD7wPMdeetCv36cmU9 cGBXE/74w8KnSZWTW2Au/DeF3e0sJl7+qj+evM7sLjzXB35DYgNCf5ZnBza97Ra0 QOCHTMldpMtIHflXGDbBssMyWmoxQd8jn11VLaQdjrfZxIeBMQAQDhApdTrE3kmx WQjO+QGRJBQ9DAozOwV9wf4ASMPV3IDMSyRSlFJB7vKQUgdKnO8QUddmV/R3JTk= =sm3v -----END PGP SIGNATURE----- --iXkUaDPpdUAot7O9i1kxuB9vtt3ljv4f5--