[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.
- From: Lai Jiangshan <laijs cn fujitsu com>
- To: Eric Blake <eblake redhat com>
- Cc: libvirt-list redhat com
- Subject: Re: [libvirt] [PATCH 1/3 V6] add nodeGetCPUmap() for getting available CPU IDs in a cpumap.
- Date: Thu, 23 Feb 2012 09:11:12 +0800
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]