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

Re: [libvirt] [PATCHv3 3/4] virNodeGetCPUMap: Implement support function in nodeinfo



On 10/25/2012 03:49 AM, Eric Blake wrote:


+int nodeGetCPUMap(virConnectPtr conn,
+                  unsigned char **cpumap,
+                  unsigned int *online,
+                  unsigned int flags)
+{
+    virBitmapPtr cpus = NULL;
+    int maxpresent;
+    int ret = -1;
+    int dummy;
+
+    virCheckFlags(0, -1);
+
+    if (!(cpus = nodeGetCPUBitmap(conn, &maxpresent)))
+        goto cleanup;
+
+    if (cpumap && virBitmapToData(cpus, cpumap, &dummy) < 0)
+        goto cleanup;
+    if (online)
+        *online = virBitmapCountBits(cpus);
Much nicer now.

Tested-by: Viktor Mihajlovski <mihajlov linux vnet ibm com>

--

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


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