[libvirt] [PATCH] vmx: Use case-insensitive compare functions for all content

Daniel Veillard veillard at redhat.com
Mon Apr 4 03:02:37 UTC 2011


On Sun, Apr 03, 2011 at 02:19:14PM +0200, Matthias Bolte wrote:
> ---
>  src/vmx/vmx.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
> index 9f4d5fb..9a482ef 100644
> --- a/src/vmx/vmx.c
> +++ b/src/vmx/vmx.c
> @@ -730,7 +730,7 @@ virVMXGetConfigLong(virConfPtr conf, const char *name, long long *number,
>              }
>          }
>  
> -        if (STREQ(value->str, "unlimited")) {
> +        if (STRCASEEQ(value->str, "unlimited")) {
>              *number = -1;
>          } else if (virStrToLong_ll(value->str, NULL, 10, number) < 0) {
>              VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
> @@ -1385,7 +1385,7 @@ virVMXParseConfig(virVMXContext *ctx, virCapsPtr caps, const char *vmx)
>          goto cleanup;
>      }
>  
> -    if (sched_cpu_affinity != NULL && STRNEQ(sched_cpu_affinity, "all")) {
> +    if (sched_cpu_affinity != NULL && STRCASENEQ(sched_cpu_affinity, "all")) {
>          const char *current = sched_cpu_affinity;
>          int number, count = 0;
>  
> @@ -2107,7 +2107,7 @@ virVMXParseDisk(virVMXContext *ctx, virCapsPtr caps, virConfPtr conf,
>                  goto cleanup;
>              }
>          } else if (virFileHasSuffix(fileName, ".iso") ||
> -                   STREQ(deviceType, "atapi-cdrom")) {
> +                   STRCASEEQ(deviceType, "atapi-cdrom")) {
>              /*
>               * This function was called in order to parse a harddisk device,
>               * but .iso files and 'atapi-cdrom' devices are for CDROM devices
> @@ -2146,7 +2146,7 @@ virVMXParseDisk(virVMXContext *ctx, virCapsPtr caps, virConfPtr conf,
>               * handle it.
>               */
>              goto ignore;
> -        } else if (STREQ(deviceType, "atapi-cdrom")) {
> +        } else if (STRCASEEQ(deviceType, "atapi-cdrom")) {
>              (*def)->type = VIR_DOMAIN_DISK_TYPE_BLOCK;
>              (*def)->src = fileName;
>  
> @@ -2174,7 +2174,7 @@ virVMXParseDisk(virVMXContext *ctx, virCapsPtr caps, virConfPtr conf,
>              if ((*def)->src == NULL) {
>                  goto cleanup;
>              }
> -        } else if (fileType != NULL && STREQ(fileType, "device")) {
> +        } else if (fileType != NULL && STRCASEEQ(fileType, "device")) {
>              (*def)->type = VIR_DOMAIN_DISK_TYPE_BLOCK;
>              (*def)->src = fileName;

  Sounds fine to me but would you categorize this as bug fix (for 0.9.0)
or rather an improvement and wait. I guess it depends how you ended up
crossing this, and I can't guess it :-)

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list