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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/4/4 Daniel Veillard <veillard@xxxxxxxxxx>:
> 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
>

There was a bug report a while ago about the VMX parser being
case-sensitive, but the .vmx files actually being case-insensitive.
The initial fix was incomplete and I just came across this remaining
case-sensitive compares while adding persistent CPU shares.

As 0.9.0 is out of the door now, I pushed it.

Matthias

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]