From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zbqn1-0006BV-RD for qemu-devel@nongnu.org; Tue, 15 Sep 2015 10:00:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zbqmx-0000Bl-Gn for qemu-devel@nongnu.org; Tue, 15 Sep 2015 10:00:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zbqmx-0000Ba-C1 for qemu-devel@nongnu.org; Tue, 15 Sep 2015 10:00:51 -0400 References: <1442312227-19153-1-git-send-email-berrange@redhat.com> <1442312227-19153-2-git-send-email-berrange@redhat.com> From: Eric Blake Message-ID: <55F8247C.4020903@redhat.com> Date: Tue, 15 Sep 2015 08:00:28 -0600 MIME-Version: 1.0 In-Reply-To: <1442312227-19153-2-git-send-email-berrange@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="I5l8E1qSE8VhxfS5lLkmJsIDRbbn3uN9h" Subject: Re: [Qemu-devel] [PATCH PULL v2 01/11] qapi: allow override of default enum prefix naming List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , qemu-devel@nongnu.org Cc: Peter Maydell This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --I5l8E1qSE8VhxfS5lLkmJsIDRbbn3uN9h Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/15/2015 04:16 AM, Daniel P. Berrange wrote: > The camel_to_upper() method applies some heuristics to turn > a mixed case type name into an all-uppercase name. This is > used for example, to generate enum constant name prefixes. >=20 > The heuristics don't also generate a satisfactory name > though. eg >=20 > { 'enum': 'QCryptoTLSCredsEndpoint', > 'data': ['client', 'server']} >=20 > Results in Q_CRYPTOTLS_CREDS_ENDPOINT_CLIENT. This has > an undesirable _ after the initial Q and is missing an > _ between the CRYPTO & TLS strings. >=20 > Rather than try to add more and more heuristics to try > to cope with this, simply allow the QAPI schema to > specify the desired enum constant prefix explicitly. >=20 > eg >=20 > { 'enum': 'QCryptoTLSCredsEndpoint', > 'prefix': 'QCRYPTO_TLS_CREDS_ENDPOINT', > 'data': ['client', 'server']} >=20 > Now gives the QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT name. >=20 > Signed-off-by: Daniel P. Berrange > --- Since you are doing a v3; if you want, you can add: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --I5l8E1qSE8VhxfS5lLkmJsIDRbbn3uN9h 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/ iQEcBAEBCAAGBQJV+CR9AAoJEKeha0olJ0NqjzYH/1kOuWu2Do7ep5cSpEo2yvUW YgAPzL1unhp0WrTMxw+85ZtsoExcSE4QahRwfAqFZLjoSoQ7HvVnKF5pdh0FRm7t nu0puJ8g2w4rSnm8ALkfIHtAWpJbzuuwRd7v2iSGV6fVS/n052NgKXNXil9J+ZZF eUD1nlzD5uptS4zEtMZA+7wBJh7aM30dlVH28wAf/G6INiqvLofXdjnRZtn+qKbt bwe8o1SLzU9iV+TjRSO3pWBjMRNJmUCZNR2qgkDJICMBJ+9BGew0nJNUCS30UD7t NfYOJU9ZnlT8YTrcryxN846foTEzZ5zz8ZQo7/UZ6PGEUFlYjeKln7XMAGmvDnY= =nRIP -----END PGP SIGNATURE----- --I5l8E1qSE8VhxfS5lLkmJsIDRbbn3uN9h--