unsigned int flags)
{
virDomainResctrlDefPtr resctrl = NULL;
- virDomainResctrlDefPtr ret = NULL;
g_autofree char *vcpus_str = NULL;
g_autofree char *alloc_id = NULL;
}
if (virResctrlAllocSetID(alloc, alloc_id) < 0)
- goto cleanup;
-
- if (VIR_ALLOC(resctrl) < 0)
- goto cleanup;
+ return NULL;
+ resctrl = g_new0(virDomainResctrlDef, 1);
resctrl->vcpus = virBitmapNewCopy(vcpus);
resctrl->alloc = virObjectRef(alloc);
- ret = g_steal_pointer(&resctrl);
- cleanup:
- virDomainResctrlDefFree(resctrl);
- return ret;
+ return resctrl;
}