mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
Revert "util: cgroup: modify virCgroupFree to take virCgroupPtr"
This reverts commit 0f80c71822d82465d558d697d3be9af2d21e3675. Turns out, our code relies on virCgroupFree(&var) setting var = NULL. Conflicts: src/util/vircgroup.c: context because 94f1855f099445d is not reverted. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
e0b46ad623
commit
6f9fb4fa01
@ -309,12 +309,12 @@ int virDomainLxcEnterCGroup(virDomainPtr domain,
|
||||
if (virCgroupAddTask(cgroup, getpid()) < 0)
|
||||
goto error;
|
||||
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
virDispatchError(NULL);
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
return -1;
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ int virLXCCgroupGetMeminfo(virLXCMeminfoPtr meminfo)
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -515,7 +515,7 @@ virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def,
|
||||
def->idmap.uidmap[0].target,
|
||||
def->idmap.gidmap[0].target,
|
||||
(1 << VIR_CGROUP_CONTROLLER_SYSTEMD)) < 0) {
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
cgroup = NULL;
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1815,7 +1815,7 @@ static int lxcContainerSetupPivotRoot(virDomainDefPtr vmDef,
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(stateDir);
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
VIR_FREE(sec_mount_options);
|
||||
return ret;
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ static void virLXCControllerFree(virLXCControllerPtr ctrl)
|
||||
VIR_FREE(ctrl->nbdpids);
|
||||
|
||||
VIR_FREE(ctrl->nsFDs);
|
||||
virCgroupFree(ctrl->cgroup);
|
||||
virCgroupFree(&ctrl->cgroup);
|
||||
|
||||
/* This must always be the last thing to be closed */
|
||||
VIR_FORCE_CLOSE(ctrl->handshakeFd);
|
||||
|
@ -172,7 +172,7 @@ virLXCDomainObjPrivateFree(void *data)
|
||||
{
|
||||
virLXCDomainObjPrivatePtr priv = data;
|
||||
|
||||
virCgroupFree(priv->cgroup);
|
||||
virCgroupFree(&priv->cgroup);
|
||||
virLXCDomainObjFreeJob(priv);
|
||||
VIR_FREE(priv);
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ static void virLXCProcessCleanup(virLXCDriverPtr driver,
|
||||
|
||||
if (priv->cgroup) {
|
||||
virCgroupRemove(priv->cgroup);
|
||||
virCgroupFree(priv->cgroup);
|
||||
virCgroupFree(&priv->cgroup);
|
||||
}
|
||||
|
||||
/* Get machined to terminate the machine as it may not have cleaned it
|
||||
@ -1201,26 +1201,26 @@ int virLXCProcessStart(virConnectPtr conn,
|
||||
|
||||
if (!virCgroupHasController(selfcgroup,
|
||||
VIR_CGROUP_CONTROLLER_CPUACCT)) {
|
||||
virCgroupFree(selfcgroup);
|
||||
virCgroupFree(&selfcgroup);
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Unable to find 'cpuacct' cgroups controller mount"));
|
||||
return -1;
|
||||
}
|
||||
if (!virCgroupHasController(selfcgroup,
|
||||
VIR_CGROUP_CONTROLLER_DEVICES)) {
|
||||
virCgroupFree(selfcgroup);
|
||||
virCgroupFree(&selfcgroup);
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Unable to find 'devices' cgroups controller mount"));
|
||||
return -1;
|
||||
}
|
||||
if (!virCgroupHasController(selfcgroup,
|
||||
VIR_CGROUP_CONTROLLER_MEMORY)) {
|
||||
virCgroupFree(selfcgroup);
|
||||
virCgroupFree(&selfcgroup);
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Unable to find 'memory' cgroups controller mount"));
|
||||
return -1;
|
||||
}
|
||||
virCgroupFree(selfcgroup);
|
||||
virCgroupFree(&selfcgroup);
|
||||
|
||||
if (vm->def->nconsoles == 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
|
@ -841,7 +841,7 @@ qemuSetupCpusetMems(virDomainObjPtr vm)
|
||||
ret = 0;
|
||||
cleanup:
|
||||
VIR_FREE(mem_mask);
|
||||
virCgroupFree(cgroup_temp);
|
||||
virCgroupFree(&cgroup_temp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -920,7 +920,7 @@ qemuInitCgroup(virDomainObjPtr vm,
|
||||
if (!virCgroupAvailable())
|
||||
goto done;
|
||||
|
||||
virCgroupFree(priv->cgroup);
|
||||
virCgroupFree(&priv->cgroup);
|
||||
|
||||
if (!vm->def->resource) {
|
||||
virDomainResourceDefPtr res;
|
||||
@ -1008,7 +1008,7 @@ qemuRestoreCgroupState(virDomainObjPtr vm)
|
||||
goto cleanup;
|
||||
|
||||
VIR_FREE(nodeset);
|
||||
virCgroupFree(cgroup_temp);
|
||||
virCgroupFree(&cgroup_temp);
|
||||
}
|
||||
|
||||
for (i = 0; i < vm->def->niothreadids; i++) {
|
||||
@ -1021,7 +1021,7 @@ qemuRestoreCgroupState(virDomainObjPtr vm)
|
||||
goto cleanup;
|
||||
|
||||
VIR_FREE(nodeset);
|
||||
virCgroupFree(cgroup_temp);
|
||||
virCgroupFree(&cgroup_temp);
|
||||
}
|
||||
|
||||
if (virCgroupNewThread(priv->cgroup, VIR_CGROUP_THREAD_EMULATOR, 0,
|
||||
@ -1035,7 +1035,7 @@ qemuRestoreCgroupState(virDomainObjPtr vm)
|
||||
VIR_FREE(mem_mask);
|
||||
VIR_FREE(nodeset);
|
||||
virBitmapFree(all_nodes);
|
||||
virCgroupFree(cgroup_temp);
|
||||
virCgroupFree(&cgroup_temp);
|
||||
return;
|
||||
|
||||
error:
|
||||
@ -1057,7 +1057,7 @@ qemuConnectCgroup(virDomainObjPtr vm)
|
||||
if (!virCgroupAvailable())
|
||||
goto done;
|
||||
|
||||
virCgroupFree(priv->cgroup);
|
||||
virCgroupFree(&priv->cgroup);
|
||||
|
||||
if (virCgroupNewDetectMachine(vm->def->name,
|
||||
"qemu",
|
||||
@ -1203,7 +1203,7 @@ qemuSetupCgroupForExtDevices(virDomainObjPtr vm,
|
||||
ret = qemuExtDevicesSetupCgroup(driver, vm->def, cgroup_temp);
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup_temp);
|
||||
virCgroupFree(&cgroup_temp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -1281,7 +1281,7 @@ qemuCgroupEmulatorAllNodesDataFree(qemuCgroupEmulatorAllNodesDataPtr data)
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
virCgroupFree(data->emulatorCgroup);
|
||||
virCgroupFree(&data->emulatorCgroup);
|
||||
VIR_FREE(data->emulatorMemMask);
|
||||
VIR_FREE(data);
|
||||
}
|
||||
|
@ -1920,7 +1920,7 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivatePtr priv)
|
||||
virStringListFree(priv->qemuDevices);
|
||||
priv->qemuDevices = NULL;
|
||||
|
||||
virCgroupFree(priv->cgroup);
|
||||
virCgroupFree(&priv->cgroup);
|
||||
|
||||
virPerfFree(priv->perf);
|
||||
priv->perf = NULL;
|
||||
|
@ -5078,7 +5078,7 @@ qemuDomainPinVcpuLive(virDomainObjPtr vm,
|
||||
|
||||
cleanup:
|
||||
virBitmapFree(tmpmap);
|
||||
virCgroupFree(cgroup_vcpu);
|
||||
virCgroupFree(&cgroup_vcpu);
|
||||
VIR_FREE(str);
|
||||
virObjectEventStateQueue(driver->domainEventState, event);
|
||||
return ret;
|
||||
@ -5315,7 +5315,8 @@ qemuDomainPinEmulator(virDomainPtr dom,
|
||||
qemuDomainObjEndJob(driver, vm);
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup_emulator);
|
||||
if (cgroup_emulator)
|
||||
virCgroupFree(&cgroup_emulator);
|
||||
virObjectEventStateQueue(driver->domainEventState, event);
|
||||
VIR_FREE(str);
|
||||
virBitmapFree(pcpumap);
|
||||
@ -5796,7 +5797,8 @@ qemuDomainPinIOThread(virDomainPtr dom,
|
||||
qemuDomainObjEndJob(driver, vm);
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup_iothread);
|
||||
if (cgroup_iothread)
|
||||
virCgroupFree(&cgroup_iothread);
|
||||
virObjectEventStateQueue(driver->domainEventState, event);
|
||||
VIR_FREE(str);
|
||||
virBitmapFree(pcpumap);
|
||||
@ -9850,7 +9852,7 @@ qemuDomainSetNumaParamsLive(virDomainObjPtr vm,
|
||||
false, &cgroup_temp) < 0 ||
|
||||
virCgroupSetCpusetMems(cgroup_temp, nodeset_str) < 0)
|
||||
goto cleanup;
|
||||
virCgroupFree(cgroup_temp);
|
||||
virCgroupFree(&cgroup_temp);
|
||||
|
||||
for (i = 0; i < virDomainDefGetVcpusMax(vm->def); i++) {
|
||||
virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(vm->def, i);
|
||||
@ -9862,7 +9864,7 @@ qemuDomainSetNumaParamsLive(virDomainObjPtr vm,
|
||||
false, &cgroup_temp) < 0 ||
|
||||
virCgroupSetCpusetMems(cgroup_temp, nodeset_str) < 0)
|
||||
goto cleanup;
|
||||
virCgroupFree(cgroup_temp);
|
||||
virCgroupFree(&cgroup_temp);
|
||||
}
|
||||
|
||||
for (i = 0; i < vm->def->niothreadids; i++) {
|
||||
@ -9871,13 +9873,13 @@ qemuDomainSetNumaParamsLive(virDomainObjPtr vm,
|
||||
false, &cgroup_temp) < 0 ||
|
||||
virCgroupSetCpusetMems(cgroup_temp, nodeset_str) < 0)
|
||||
goto cleanup;
|
||||
virCgroupFree(cgroup_temp);
|
||||
virCgroupFree(&cgroup_temp);
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
VIR_FREE(nodeset_str);
|
||||
virCgroupFree(cgroup_temp);
|
||||
virCgroupFree(&cgroup_temp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -10299,13 +10301,13 @@ qemuSetVcpusBWLive(virDomainObjPtr vm, virCgroupPtr cgroup,
|
||||
if (qemuSetupCgroupVcpuBW(cgroup_vcpu, period, quota) < 0)
|
||||
goto cleanup;
|
||||
|
||||
virCgroupFree(cgroup_vcpu);
|
||||
virCgroupFree(&cgroup_vcpu);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup_vcpu);
|
||||
virCgroupFree(&cgroup_vcpu);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -10326,11 +10328,11 @@ qemuSetEmulatorBandwidthLive(virCgroupPtr cgroup,
|
||||
if (qemuSetupCgroupVcpuBW(cgroup_emulator, period, quota) < 0)
|
||||
goto cleanup;
|
||||
|
||||
virCgroupFree(cgroup_emulator);
|
||||
virCgroupFree(&cgroup_emulator);
|
||||
return 0;
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup_emulator);
|
||||
virCgroupFree(&cgroup_emulator);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -10357,13 +10359,13 @@ qemuSetIOThreadsBWLive(virDomainObjPtr vm, virCgroupPtr cgroup,
|
||||
if (qemuSetupCgroupVcpuBW(cgroup_iothread, period, quota) < 0)
|
||||
goto cleanup;
|
||||
|
||||
virCgroupFree(cgroup_iothread);
|
||||
virCgroupFree(&cgroup_iothread);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup_iothread);
|
||||
virCgroupFree(&cgroup_iothread);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -10749,7 +10751,7 @@ qemuGetVcpusBWLive(virDomainObjPtr vm,
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup_vcpu);
|
||||
virCgroupFree(&cgroup_vcpu);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -10772,7 +10774,7 @@ qemuGetEmulatorBandwidthLive(virCgroupPtr cgroup,
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup_emulator);
|
||||
virCgroupFree(&cgroup_emulator);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -10808,7 +10810,7 @@ qemuGetIOThreadsBWLive(virDomainObjPtr vm,
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup_iothread);
|
||||
virCgroupFree(&cgroup_iothread);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -2532,7 +2532,7 @@ qemuProcessSetupPid(virDomainObjPtr vm,
|
||||
if (cgroup) {
|
||||
if (ret < 0)
|
||||
virCgroupRemove(cgroup);
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -1118,7 +1118,7 @@ virCgroupNew(pid_t pid,
|
||||
return 0;
|
||||
|
||||
error:
|
||||
virCgroupFree(*group);
|
||||
virCgroupFree(group);
|
||||
*group = NULL;
|
||||
|
||||
return -1;
|
||||
@ -1319,8 +1319,8 @@ virCgroupNewPartition(const char *path,
|
||||
ret = 0;
|
||||
cleanup:
|
||||
if (ret != 0)
|
||||
virCgroupFree(*group);
|
||||
virCgroupFree(parent);
|
||||
virCgroupFree(group);
|
||||
virCgroupFree(&parent);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1384,7 +1384,7 @@ virCgroupNewDomainPartition(virCgroupPtr partition,
|
||||
if (virCgroupMakeGroup(partition, *group, create,
|
||||
VIR_CGROUP_MEM_HIERACHY) < 0) {
|
||||
virCgroupRemove(*group);
|
||||
virCgroupFree(*group);
|
||||
virCgroupFree(group);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1441,7 +1441,7 @@ virCgroupNewThread(virCgroupPtr domain,
|
||||
|
||||
if (virCgroupMakeGroup(domain, *group, create, VIR_CGROUP_NONE) < 0) {
|
||||
virCgroupRemove(*group);
|
||||
virCgroupFree(*group);
|
||||
virCgroupFree(group);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1479,7 +1479,7 @@ virCgroupNewDetectMachine(const char *name,
|
||||
true, machinename)) {
|
||||
VIR_DEBUG("Failed to validate machine name for '%s' driver '%s'",
|
||||
name, drivername);
|
||||
virCgroupFree(*group);
|
||||
virCgroupFree(group);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1532,7 +1532,7 @@ virCgroupNewMachineSystemd(const char *name,
|
||||
|
||||
path = init->controllers[VIR_CGROUP_CONTROLLER_SYSTEMD].placement;
|
||||
init->controllers[VIR_CGROUP_CONTROLLER_SYSTEMD].placement = NULL;
|
||||
virCgroupFree(init);
|
||||
virCgroupFree(&init);
|
||||
|
||||
if (!path || STREQ(path, "/") || path[0] != '/') {
|
||||
VIR_DEBUG("Systemd didn't setup its controller");
|
||||
@ -1564,13 +1564,13 @@ virCgroupNewMachineSystemd(const char *name,
|
||||
goto cleanup;
|
||||
|
||||
if (virCgroupMakeGroup(parent, tmp, true, VIR_CGROUP_NONE) < 0) {
|
||||
virCgroupFree(tmp);
|
||||
virCgroupFree(&tmp);
|
||||
goto cleanup;
|
||||
}
|
||||
if (t) {
|
||||
*t = '/';
|
||||
offset = t;
|
||||
virCgroupFree(parent);
|
||||
virCgroupFree(&parent);
|
||||
parent = tmp;
|
||||
} else {
|
||||
*group = tmp;
|
||||
@ -1581,7 +1581,7 @@ virCgroupNewMachineSystemd(const char *name,
|
||||
if (virCgroupAddTask(*group, pidleader) < 0) {
|
||||
virErrorPtr saved = virSaveLastError();
|
||||
virCgroupRemove(*group);
|
||||
virCgroupFree(*group);
|
||||
virCgroupFree(group);
|
||||
if (saved) {
|
||||
virSetError(saved);
|
||||
virFreeError(saved);
|
||||
@ -1590,7 +1590,7 @@ virCgroupNewMachineSystemd(const char *name,
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
virCgroupFree(parent);
|
||||
virCgroupFree(&parent);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1636,7 +1636,7 @@ virCgroupNewMachineManual(const char *name,
|
||||
if (virCgroupAddTask(*group, pidleader) < 0) {
|
||||
virErrorPtr saved = virSaveLastError();
|
||||
virCgroupRemove(*group);
|
||||
virCgroupFree(*group);
|
||||
virCgroupFree(group);
|
||||
if (saved) {
|
||||
virSetError(saved);
|
||||
virFreeError(saved);
|
||||
@ -1647,7 +1647,7 @@ virCgroupNewMachineManual(const char *name,
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(parent);
|
||||
virCgroupFree(&parent);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1714,21 +1714,21 @@ virCgroupNewIgnoreError(void)
|
||||
* @group: The group structure to free
|
||||
*/
|
||||
void
|
||||
virCgroupFree(virCgroupPtr group)
|
||||
virCgroupFree(virCgroupPtr *group)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (!group)
|
||||
if (*group == NULL)
|
||||
return;
|
||||
|
||||
for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
|
||||
VIR_FREE(group->controllers[i].mountPoint);
|
||||
VIR_FREE(group->controllers[i].linkPoint);
|
||||
VIR_FREE(group->controllers[i].placement);
|
||||
VIR_FREE((*group)->controllers[i].mountPoint);
|
||||
VIR_FREE((*group)->controllers[i].linkPoint);
|
||||
VIR_FREE((*group)->controllers[i].placement);
|
||||
}
|
||||
|
||||
VIR_FREE(group->path);
|
||||
VIR_FREE(group);
|
||||
VIR_FREE((*group)->path);
|
||||
VIR_FREE(*group);
|
||||
}
|
||||
|
||||
|
||||
@ -2391,7 +2391,7 @@ virCgroupMemoryOnceInit(void)
|
||||
"memory.limit_in_bytes",
|
||||
&mem_unlimited));
|
||||
cleanup:
|
||||
virCgroupFree(group);
|
||||
virCgroupFree(&group);
|
||||
virCgroupMemoryUnlimitedKB = mem_unlimited >> 10;
|
||||
}
|
||||
|
||||
@ -3021,12 +3021,12 @@ virCgroupGetPercpuVcpuSum(virCgroupPtr group,
|
||||
sum_cpu_time[j] += tmp;
|
||||
}
|
||||
|
||||
virCgroupFree(group_vcpu);
|
||||
virCgroupFree(&group_vcpu);
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
virCgroupFree(group_vcpu);
|
||||
virCgroupFree(&group_vcpu);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -3579,7 +3579,7 @@ virCgroupKillRecursiveInternal(virCgroupPtr group,
|
||||
if (dormdir)
|
||||
virCgroupRemove(subgroup);
|
||||
|
||||
virCgroupFree(subgroup);
|
||||
virCgroupFree(&subgroup);
|
||||
}
|
||||
if (direrr < 0)
|
||||
goto cleanup;
|
||||
@ -3588,7 +3588,7 @@ virCgroupKillRecursiveInternal(virCgroupPtr group,
|
||||
ret = killedAny ? 1 : 0;
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(subgroup);
|
||||
virCgroupFree(&subgroup);
|
||||
VIR_DIR_CLOSE(dp);
|
||||
return ret;
|
||||
}
|
||||
@ -3952,7 +3952,7 @@ virCgroupControllerAvailable(int controller)
|
||||
return ret;
|
||||
|
||||
ret = virCgroupHasController(cgroup, controller);
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -4084,7 +4084,7 @@ virCgroupNewIgnoreError(void)
|
||||
|
||||
|
||||
void
|
||||
virCgroupFree(virCgroupPtr group ATTRIBUTE_UNUSED)
|
||||
virCgroupFree(virCgroupPtr *group ATTRIBUTE_UNUSED)
|
||||
{
|
||||
virReportSystemError(ENXIO, "%s",
|
||||
_("Control groups not supported on this platform"));
|
||||
@ -4749,7 +4749,7 @@ virCgroupDelThread(virCgroupPtr cgroup,
|
||||
|
||||
/* Remove the offlined cgroup */
|
||||
virCgroupRemove(new_cgroup);
|
||||
virCgroupFree(new_cgroup);
|
||||
virCgroupFree(&new_cgroup);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -122,7 +122,7 @@ int virCgroupTerminateMachine(const char *name)
|
||||
|
||||
bool virCgroupNewIgnoreError(void);
|
||||
|
||||
void virCgroupFree(virCgroupPtr group);
|
||||
void virCgroupFree(virCgroupPtr *group);
|
||||
|
||||
bool virCgroupHasController(virCgroupPtr cgroup, int controller);
|
||||
int virCgroupPathOfController(virCgroupPtr group,
|
||||
|
@ -198,7 +198,7 @@ testCgroupDetectMounts(const void *args)
|
||||
cleanup:
|
||||
VIR_FREE(mounts);
|
||||
VIR_FREE(parsed);
|
||||
virCgroupFree(group);
|
||||
virCgroupFree(&group);
|
||||
virBufferFreeAndReset(&buf);
|
||||
return result;
|
||||
}
|
||||
@ -227,7 +227,7 @@ static int testCgroupNewForSelf(const void *args ATTRIBUTE_UNUSED)
|
||||
ret = validateCgroup(cgroup, "", mountsFull, links, placement);
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -304,7 +304,7 @@ static int testCgroupNewForPartition(const void *args ATTRIBUTE_UNUSED)
|
||||
goto cleanup;
|
||||
}
|
||||
ret = validateCgroup(cgroup, "/virtualmachines.partition", mountsSmall, links, placementSmall);
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
|
||||
if ((rv = virCgroupNewPartition("/virtualmachines", true, -1, &cgroup)) != 0) {
|
||||
fprintf(stderr, "Cannot create /virtualmachines cgroup: %d\n", -rv);
|
||||
@ -313,7 +313,7 @@ static int testCgroupNewForPartition(const void *args ATTRIBUTE_UNUSED)
|
||||
ret = validateCgroup(cgroup, "/virtualmachines.partition", mountsFull, links, placementFull);
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -353,7 +353,7 @@ static int testCgroupNewForPartitionNested(const void *args ATTRIBUTE_UNUSED)
|
||||
}
|
||||
|
||||
/* Should now work */
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
if ((rv = virCgroupNewPartition("/deployment/production", true, -1, &cgroup)) != 0) {
|
||||
fprintf(stderr, "Failed to create /deployment/production cgroup: %d\n", -rv);
|
||||
goto cleanup;
|
||||
@ -363,7 +363,7 @@ static int testCgroupNewForPartitionNested(const void *args ATTRIBUTE_UNUSED)
|
||||
mountsFull, links, placementFull);
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -402,14 +402,14 @@ static int testCgroupNewForPartitionNestedDeep(const void *args ATTRIBUTE_UNUSED
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
if ((rv = virCgroupNewPartition("/user/berrange.user", true, -1, &cgroup)) != 0) {
|
||||
fprintf(stderr, "Failed to create /user/berrange.user cgroup: %d\n", -rv);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Should now work */
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
if ((rv = virCgroupNewPartition("/user/berrange.user/production", true, -1, &cgroup)) != 0) {
|
||||
fprintf(stderr, "Failed to create /user/berrange.user/production cgroup: %d\n", -rv);
|
||||
goto cleanup;
|
||||
@ -419,7 +419,7 @@ static int testCgroupNewForPartitionNestedDeep(const void *args ATTRIBUTE_UNUSED
|
||||
mountsFull, links, placementFull);
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -455,8 +455,8 @@ static int testCgroupNewForPartitionDomain(const void *args ATTRIBUTE_UNUSED)
|
||||
ret = validateCgroup(domaincgroup, "/production.partition/foo.libvirt-lxc", mountsFull, links, placement);
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(partitioncgroup);
|
||||
virCgroupFree(domaincgroup);
|
||||
virCgroupFree(&partitioncgroup);
|
||||
virCgroupFree(&domaincgroup);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -506,10 +506,10 @@ static int testCgroupNewForPartitionDomainEscaped(const void *args ATTRIBUTE_UNU
|
||||
ret = validateCgroup(domaincgroup, "/_cgroup.evil/net_cls.evil/__evil.evil/_cpu.foo.libvirt-lxc", mountsFull, links, placement);
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(partitioncgroup3);
|
||||
virCgroupFree(partitioncgroup2);
|
||||
virCgroupFree(partitioncgroup1);
|
||||
virCgroupFree(domaincgroup);
|
||||
virCgroupFree(&partitioncgroup3);
|
||||
virCgroupFree(&partitioncgroup2);
|
||||
virCgroupFree(&partitioncgroup1);
|
||||
virCgroupFree(&domaincgroup);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -535,7 +535,7 @@ static int testCgroupNewForSelfAllInOne(const void *args ATTRIBUTE_UNUSED)
|
||||
ret = validateCgroup(cgroup, "", mountsAllInOne, linksAllInOne, placement);
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -563,7 +563,7 @@ static int testCgroupNewForSelfLogind(const void *args ATTRIBUTE_UNUSED)
|
||||
ret = validateCgroup(cgroup, "", mountsLogind, linksLogind, placement);
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -690,7 +690,7 @@ static int testCgroupGetPercpuStats(const void *args ATTRIBUTE_UNUSED)
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
VIR_FREE(params);
|
||||
return ret;
|
||||
}
|
||||
@ -723,7 +723,7 @@ static int testCgroupGetMemoryUsage(const void *args ATTRIBUTE_UNUSED)
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -773,7 +773,7 @@ static int testCgroupGetBlkioIoServiced(const void *args ATTRIBUTE_UNUSED)
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -846,7 +846,7 @@ static int testCgroupGetBlkioIoDeviceServiced(const void *args ATTRIBUTE_UNUSED)
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
virCgroupFree(cgroup);
|
||||
virCgroupFree(&cgroup);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user