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

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



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.


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