[libvirt] [RFC] New API to retrieve node CPU map
Viktor Mihajlovski
mihajlov at linux.vnet.ibm.com
Thu Oct 11 13:15:36 UTC 2012
On 10/11/2012 02:27 PM, Eric Blake wrote:
>
> That starts to feel rather complex.
well :-)
>
> On the other hand, you have a point that returning maplen (number of
> bytes allocated in the map) does NOT tell you how many cpus are online
> without doing a population count of the result; worse, it cannot tell
> you how many cpus are offline (a maplen of 1 is returned whether I have
> 4 cpus or 8 cpus, so if the map contains the value 0xb, does that mean I
> had a 4 cpu machine with cpu2 off, or an 8 cpu machine with cpu2 and
> cpu4-7 off?). So allowing the user to optionally ask how many cpus are
> online or offline might indeed also be useful, in addition to the maplen
> needed to return the bitmap.
>
I actually thought of returning the number of CPUs, i.e. relevant bits which
of course makes either 'online' or 'offline' redundant.
The maplen - if of interest - can be computed by VIR_CPU_MAPLEN.
--
Mit freundlichen Grüßen/Kind Regards
Viktor Mihajlovski
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
More information about the libvir-list
mailing list