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

Lai Jiangshan laijs at cn.fujitsu.com
Thu Feb 23 01:11:12 UTC 2012


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.




More information about the libvir-list mailing list