On Thu, Mar 05, 2015 at 07:51:33AM -0500, John Ferlan wrote:
>> + for (i = 0; i < targetDef->iothreads; i++) {
>> + if (VIR_ALLOC(info_ret[i]) < 0)
>> + goto cleanup;
>> +
>> + /* IOThreads being counting at 1 */
>> + info_ret[i]->iothread_id = i + 1;
>> +
>> + if (VIR_ALLOC_N(info_ret[i]->cpumap, maplen) < 0)
>> + goto cleanup;
>> +
>> + /* Initialize the cpumap */
>> + info_ret[i]->cpumaplen = maplen;
>> + memset(info_ret[i]->cpumap, 0xff, maplen);
>> + if (maxcpu % 8)
>> + info_ret[i]->cpumap[maplen - 1] &= (1 << maxcpu % 8) -
1;
>
> virBitmapToData could make this more readable.
>
This is where I'm not sure varying from the existing API's model w/r/t
cpumap & maplen, etc. should be done..
Yes, virBitmapToData converts it from the virBitmap format used by
theiothreadspin info to the cpumap/maplen format matching the API you
proposed.
>> + }
>> +
>> + /* If iothreadspin setting exists, there are unused physical cpus */
>> + iothreadspin_list = targetDef->cputune.iothreadspin;
>
> A temporary variable pointing to iothreadspin[i] is more common.
>
straight copy of qemuDomainGetVcpuPinInfo
Oh, that explains it.
Jan