+ info = calloc(max, sizeof(*info));
+ if (info == NULL) {
+ CU_DEBUG("Failed to allocate %i vcpuinfo structures", max);
+ return -1;
+ }
+
+ count = virDomainGetVcpus(dom, info, max, NULL, 0);
+
+ free(info);
You free info here..
+
+ for (i = 0; i < count; i++) {
+ if (info[i].cpu != -1)
But use one of its fields in the compare here.
+ actual++;
+ }
+
+ return actual;
+}
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com