
28 Oct
2008
28 Oct
'08
4:09 p.m.
+ 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@linux.vnet.ibm.com