virBitmapPtr autoCpuset)
{
int maxvcpus = virDomainDefGetVcpusMax(def);
- virBitmapPtr allcpumap = NULL;
size_t i;
+ VIR_AUTOPTR(virBitmap) allcpumap = NULL;
if (hostcpus < 0)
return -1;
virBitmapToDataBuf(bitmap, VIR_GET_CPUMAP(cpumaps, maplen, i), maplen);
}
- virBitmapFree(allcpumap);
return i;
}
size_t i;
ssize_t nxt = -1;
virDomainIOThreadIDDefPtr iothrid = NULL;
- virBitmapPtr thrmap = NULL;
+ VIR_AUTOPTR(virBitmap) thrmap = NULL;
/* Same value (either 0 or some number), then we have none to fill in or
* the iothreadid array was filled from the XML
retval = 0;
error:
- virBitmapFree(thrmap);
return retval;
}
{
int ret = -1;
virDomainIOThreadIDDefPtr iothrid;
- virBitmapPtr cpumask = NULL;
unsigned int iothreadid;
char *tmp = NULL;
+ VIR_AUTOPTR(virBitmap) cpumask = NULL;
if (!(tmp = virXMLPropString(node, "iothread"))) {
virReportError(VIR_ERR_XML_ERROR, "%s",
cleanup:
VIR_FREE(tmp);
- virBitmapFree(cpumask);
return ret;
}
static virBitmapPtr
virDomainEmulatorPinDefParseXML(xmlNodePtr node)
{
- virBitmapPtr def = NULL;
virBitmapPtr ret = NULL;
char *tmp = NULL;
+ VIR_AUTOPTR(virBitmap) def = NULL;
if (!(tmp = virXMLPropString(node, "cpuset"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
VIR_STEAL_PTR(ret, def);
cleanup:
- virBitmapFree(def);
VIR_FREE(tmp);
return ret;
}
virDomainDefPtr def)
{
ssize_t next = -1;
- virBitmapPtr map = NULL;
virDomainThreadSchedParamPtr sched;
virProcessSchedPolicy policy;
int priority;
int ret = -1;
+ VIR_AUTOPTR(virBitmap) map = NULL;
if (!(map = virDomainSchedulerParse(node, name, &policy, &priority)))
goto cleanup;
ret = 0;
cleanup:
- virBitmapFree(map);
return ret;
}
{
xmlNodePtr oldnode = ctxt->node;
xmlNodePtr *nodes = NULL;
- virBitmapPtr vcpus = NULL;
virResctrlAllocPtr alloc = NULL;
virDomainResctrlDefPtr resctrl = NULL;
ssize_t i = 0;
int n;
int ret = -1;
+ VIR_AUTOPTR(virBitmap) vcpus = NULL;
ctxt->node = node;
ctxt->node = oldnode;
virDomainResctrlDefFree(resctrl);
virObjectUnref(alloc);
- virBitmapFree(vcpus);
VIR_FREE(nodes);
return ret;
}
{
xmlNodePtr oldnode = ctxt->node;
xmlNodePtr *nodes = NULL;
- virBitmapPtr vcpus = NULL;
virResctrlAllocPtr alloc = NULL;
virDomainResctrlDefPtr resctrl = NULL;
+ VIR_AUTOPTR(virBitmap) vcpus = NULL;
ssize_t i = 0;
int n;
ctxt->node = oldnode;
virDomainResctrlDefFree(resctrl);
virObjectUnref(alloc);
- virBitmapFree(vcpus);
VIR_FREE(nodes);
return ret;
}