[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] qemu-opts: introduce a function to compare
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] qemu-opts: introduce a function to compare option names |
Date: |
Wed, 25 Jul 2012 10:45:02 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 |
On 07/25/2012 10:25 AM, Anthony Liguori wrote:
> We don't use the standard C functions for conversion because we don't want to
> depend on the user's locale. All option names in QEMU are en_US in plain
> 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.]
>
> Signed-off-by: Anthony Liguori <address@hidden>
> ---
> qemu-option.c | 53 +++++++++++++++++++++++++++++++++++++++++++++--------
> qemu-option.h | 2 ++
> 2 files changed, 47 insertions(+), 8 deletions(-)
>
> 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, const
> char *p)
> return p;
> }
>
> +static int opt_tolower(int ch)
> +{
> + if (ch >= 'A' && ch <= 'Z') {
> + return 'a' + (ch - 'A');
> + } else if (ch == '_') {
> + return '-';
Slick - making case-insensitive comparison also fold '-' and '_' together :)
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH 2/2] qemu-config: convert all QemuOpts to use dashes instead of underscores, (continued)
- Re: [Qemu-devel] [PATCH 2/2] qemu-config: convert all QemuOpts to use dashes instead of underscores, Luiz Capitulino, 2012/07/25
- Re: [Qemu-devel] [PATCH 2/2] qemu-config: convert all QemuOpts to use dashes instead of underscores, Anthony Liguori, 2012/07/25
- Re: [Qemu-devel] [PATCH 2/2] qemu-config: convert all QemuOpts to use dashes instead of underscores, Peter Maydell, 2012/07/25
- Re: [Qemu-devel] [PATCH 2/2] qemu-config: convert all QemuOpts to use dashes instead of underscores, Luiz Capitulino, 2012/07/25
- Re: [Qemu-devel] [PATCH 2/2] qemu-config: convert all QemuOpts to use dashes instead of underscores, Peter Maydell, 2012/07/25
- [Qemu-devel] Changing qemu's -help output, Luiz Capitulino, 2012/07/25
- Re: [Qemu-devel] [libvirt] Changing qemu's -help output, Eric Blake, 2012/07/25
- Re: [Qemu-devel] [PATCH 2/2] qemu-config: convert all QemuOpts to use dashes instead of underscores, Markus Armbruster, 2012/07/27
Re: [Qemu-devel] [PATCH 2/2] qemu-config: convert all QemuOpts to use dashes instead of underscores, Andreas Färber, 2012/07/27
[Qemu-devel] [PATCH 1/2] qemu-opts: introduce a function to compare option names, Anthony Liguori, 2012/07/25
- Re: [Qemu-devel] [PATCH 1/2] qemu-opts: introduce a function to compare option names,
Eric Blake <=
Re: [Qemu-devel] [PATCH 1/2] qemu-opts: introduce a function to compare option names, Peter Maydell, 2012/07/25
Re: [Qemu-devel] [PATCH 1/2] qemu-opts: introduce a function to compare option names, Markus Armbruster, 2012/07/27
Re: [Qemu-devel] [PATCH 0/2] Allow '-' or '_' for all QemuOpts, Luiz Capitulino, 2012/07/25
Re: [Qemu-devel] [PATCH 0/2] Allow '-' or '_' for all QemuOpts, Markus Armbruster, 2012/07/27