Re: [PATCH 1/3 V6] add nodeGetCPUmap() for getting available CPU IDs in a cpumap.

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

 



On 02/23/2012 08:10 AM, Eric Blake wrote:

>> +    if (virDomainCpuSetParse(str, 0, map,
>> +                             VIR_DOMAIN_CPUMASK_LEN) < 0) {
>> +        goto error;
>> +    }
>> +
>> +    for (i = 0; i < VIR_DOMAIN_CPUMASK_LEN; i++) {
>> +        if (map[i]) {
>> +            max_id = i;
> 
> That's off by a factor of 8 - map[i] means that you have visited i*8
> bits in cpumask.

@map is not bitmask, virDomainCpuSetParse() filled it a char per a cpu.
And the return of this function is also cpumap(byte per cpu).

I will rework the patches soon after you comments them.

Thank you very much.

--lai.

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