Re: [PATCH 6/4] nodeinfo: port nodecpumap to RHEL5

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

 



On 11/16/2012 09:57 AM, Viktor Mihajlovski wrote:
> On 11/15/2012 04:38 PM, Eric Blake wrote:
>> -    cpumap = linuxParseCPUmap(present, SYSFS_SYSTEM_PATH "/cpu/online");
>> +
>> +    if (virFileExists(SYSFS_SYSTEM_PATH "/cpu/online")) {
>> +        cpumap = linuxParseCPUmap(present, SYSFS_SYSTEM_PATH
>> "/cpu/online");
>> +    } else {
>> +        int i;
>> +
>> +        cpumap = virBitmapNew(present);
>> +        if (!cpumap) {
>> +            virReportOOMError();
>> +            return NULL;
>> +        }
>> +        for (i = 0; i < present; i++) {
>> +            int online = virNodeGetCpuValue(SYSFS_SYSTEM_PATH, i,
>> "online", 1);
>> +            if (online < 0) {
>> +                virBitmapFree(cpumap);
>> +                return NULL;
>> +            }
>> +            if (online)
>> +                ignore_value(virBitmapSetBit(cpumap, i));
>> +        }
>> +    }
>>       if (max_id && cpumap)
>>           *max_id = present;
>>       return cpumap;
>>
> 
> Fallback should provide correct result on back-level kernels. The code
> doesn't use the goto error/cleanup pattern, but there's a mixture in
> nodeinfo.c anyway and it wouldn't make it anymore compact. As far as
> I am concerned: +1.
> 

Thanks for reviewing.  I've now pushed these two.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]