From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su4hu-0002qX-MY for qemu-devel@nongnu.org; Wed, 25 Jul 2012 12:45:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Su4hs-0006y8-Qh for qemu-devel@nongnu.org; Wed, 25 Jul 2012 12:45:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su4hs-0006xS-HM for qemu-devel@nongnu.org; Wed, 25 Jul 2012 12:45:04 -0400 Message-ID: <5010228E.7070704@redhat.com> Date: Wed, 25 Jul 2012 10:45:02 -0600 From: Eric Blake MIME-Version: 1.0 References: <1343233543-18561-1-git-send-email-aliguori@us.ibm.com> <1343233543-18561-2-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1343233543-18561-2-git-send-email-aliguori@us.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigE273A6D834B07468C29978F5" Subject: Re: [Qemu-devel] [PATCH 1/2] qemu-opts: introduce a function to compare option names List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Luiz Capitulino , qemu-devel@nongnu.org, Markus Armbruster This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigE273A6D834B07468C29978F5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/25/2012 10:25 AM, Anthony Liguori wrote: > We don't use the standard C functions for conversion because we don't w= ant to > depend on the user's locale. All option names in QEMU are en_US in pla= in ASCII. [Wondering if I should bring up the US 'canceled' vs. UK 'cancelled' as a counterpoint to the claim of everything being en_US, but then again, I didn't find any use of 'cancelled' as an option in qapi-schema.json.] >=20 > Signed-off-by: Anthony Liguori > --- > qemu-option.c | 53 +++++++++++++++++++++++++++++++++++++++++++++----= ---- > qemu-option.h | 2 ++ > 2 files changed, 47 insertions(+), 8 deletions(-) >=20 > diff --git a/qemu-option.c b/qemu-option.c > index 8334190..6494c99 100644 > --- a/qemu-option.c > +++ b/qemu-option.c > @@ -89,6 +89,43 @@ const char *get_opt_value(char *buf, int buf_size, c= onst char *p) > return p; > } > =20 > +static int opt_tolower(int ch) > +{ > + if (ch >=3D 'A' && ch <=3D 'Z') { > + return 'a' + (ch - 'A'); > + } else if (ch =3D=3D '_') { > + return '-'; Slick - making case-insensitive comparison also fold '-' and '_' together= :) Reviewed-by: Eric Blake --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigE273A6D834B07468C29978F5 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.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJQECKOAAoJEKeha0olJ0NqS/QH/0kEO865+tm0oZrl6AL+tYON q+gLP4w/BIn9+vdkLs9sTpMiWliVz8DqpFpj2S5RzK7Phv6V7/p8HlbbmsPjnS8Q oKOQNkDbJHo/TzvmOHLQvgCHPkOCO+WoNylC9KrrHziS0KcCOO9cnZOiD/GIP0gi BMbAunj2MtvTIKr/FCt7NhHBX4dio3w7rxVJV2fmkxulw+4UUnycZFXKHlZOm73V oSmENHTlrb0DgDfEj1eSJmB3KviPQ+zxiAIBIy7rSj7iLroIYP6oUj1S9x3eZb4P uqO9KAbsqA7RqG12wJMvYoVDgaqMt7SruRN+thmJ3i6ZCFTLzx7CD4Y2nJUIO4Y= =0C0v -----END PGP SIGNATURE----- --------------enigE273A6D834B07468C29978F5--