util: vircgroup: change virCgroupFree to take only virCgroupPtr

As preparation for g_autoptr() we need to change the function to take
only virCgroupPtr.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
Pavel Hrdina 2020-09-22 14:07:27 +02:00
parent fed04cd635
commit 5ad8272888
15 changed files with 109 additions and 91 deletions

View File

@ -307,12 +307,12 @@ int virDomainLxcEnterCGroup(virDomainPtr domain,
if (virCgroupAddProcess(cgroup, getpid()) < 0)
goto error;
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return 0;
error:
virDispatchError(NULL);
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return -1;
}

View File

@ -168,7 +168,7 @@ int virLXCCgroupGetMeminfo(virLXCMeminfoPtr meminfo)
ret = 0;
cleanup:
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return ret;
}
@ -417,7 +417,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);
return NULL;
}
}

View File

@ -1668,7 +1668,7 @@ static int lxcContainerSetupPivotRoot(virDomainDefPtr vmDef,
ret = 0;
cleanup:
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return ret;
}

View File

@ -310,7 +310,7 @@ static void virLXCControllerFree(virLXCControllerPtr ctrl)
g_free(ctrl->nbdpids);
g_free(ctrl->nsFDs);
virCgroupFree(&ctrl->cgroup);
virCgroupFree(ctrl->cgroup);
/* This must always be the last thing to be closed */
VIR_FORCE_CLOSE(ctrl->handshakeFd);

View File

@ -168,7 +168,7 @@ virLXCDomainObjPrivateFree(void *data)
{
virLXCDomainObjPrivatePtr priv = data;
virCgroupFree(&priv->cgroup);
virCgroupFree(priv->cgroup);
virLXCDomainObjFreeJob(priv);
g_free(priv);
}

View File

@ -236,7 +236,8 @@ static void virLXCProcessCleanup(virLXCDriverPtr driver,
if (priv->cgroup) {
virCgroupRemove(priv->cgroup);
virCgroupFree(&priv->cgroup);
virCgroupFree(priv->cgroup);
priv->cgroup = NULL;
}
/* Get machined to terminate the machine as it may not have cleaned it
@ -1202,26 +1203,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",

View File

@ -921,7 +921,8 @@ qemuInitCgroup(virDomainObjPtr vm,
if (!virCgroupAvailable())
return 0;
virCgroupFree(&priv->cgroup);
virCgroupFree(priv->cgroup);
priv->cgroup = NULL;
if (!vm->def->resource) {
virDomainResourceDefPtr res;
@ -983,7 +984,7 @@ qemuRestoreCgroupThread(virCgroupPtr cgroup,
ret = 0;
cleanup:
virCgroupFree(&cgroup_temp);
virCgroupFree(cgroup_temp);
return ret;
}
@ -1054,7 +1055,8 @@ qemuConnectCgroup(virDomainObjPtr vm)
if (!virCgroupAvailable())
return 0;
virCgroupFree(&priv->cgroup);
virCgroupFree(priv->cgroup);
priv->cgroup = NULL;
if (virCgroupNewDetectMachine(vm->def->name,
"qemu",
@ -1150,7 +1152,7 @@ qemuSetupCgroupForExtDevices(virDomainObjPtr vm,
ret = qemuExtDevicesSetupCgroup(driver, vm, cgroup_temp);
cleanup:
virCgroupFree(&cgroup_temp);
virCgroupFree(cgroup_temp);
return ret;
}
@ -1221,7 +1223,7 @@ qemuCgroupEmulatorAllNodesDataFree(qemuCgroupEmulatorAllNodesDataPtr data)
if (!data)
return;
virCgroupFree(&data->emulatorCgroup);
virCgroupFree(data->emulatorCgroup);
VIR_FREE(data->emulatorMemMask);
VIR_FREE(data);
}

View File

@ -1725,7 +1725,8 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivatePtr priv)
g_strfreev(priv->qemuDevices);
priv->qemuDevices = NULL;
virCgroupFree(&priv->cgroup);
virCgroupFree(priv->cgroup);
priv->cgroup = NULL;
virPerfFree(priv->perf);
priv->perf = NULL;

View File

@ -4583,7 +4583,7 @@ qemuDomainPinVcpuLive(virDomainObjPtr vm,
cleanup:
virBitmapFree(tmpmap);
virCgroupFree(&cgroup_vcpu);
virCgroupFree(cgroup_vcpu);
virObjectEventStateQueue(driver->domainEventState, event);
return ret;
}
@ -4809,7 +4809,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
cleanup:
if (cgroup_emulator)
virCgroupFree(&cgroup_emulator);
virCgroupFree(cgroup_emulator);
virObjectEventStateQueue(driver->domainEventState, event);
virBitmapFree(pcpumap);
virDomainObjEndAPI(&vm);
@ -5287,7 +5287,7 @@ qemuDomainPinIOThread(virDomainPtr dom,
cleanup:
if (cgroup_iothread)
virCgroupFree(&cgroup_iothread);
virCgroupFree(cgroup_iothread);
virObjectEventStateQueue(driver->domainEventState, event);
virBitmapFree(pcpumap);
virDomainObjEndAPI(&vm);
@ -8717,7 +8717,8 @@ qemuDomainSetNumaParamsLive(virDomainObjPtr vm,
false, &cgroup_temp) < 0 ||
virCgroupSetCpusetMems(cgroup_temp, nodeset_str) < 0)
goto cleanup;
virCgroupFree(&cgroup_temp);
virCgroupFree(cgroup_temp);
cgroup_temp = NULL;
for (i = 0; i < virDomainDefGetVcpusMax(vm->def); i++) {
virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(vm->def, i);
@ -8729,7 +8730,8 @@ qemuDomainSetNumaParamsLive(virDomainObjPtr vm,
false, &cgroup_temp) < 0 ||
virCgroupSetCpusetMems(cgroup_temp, nodeset_str) < 0)
goto cleanup;
virCgroupFree(&cgroup_temp);
virCgroupFree(cgroup_temp);
cgroup_temp = NULL;
}
for (i = 0; i < vm->def->niothreadids; i++) {
@ -8738,7 +8740,8 @@ qemuDomainSetNumaParamsLive(virDomainObjPtr vm,
false, &cgroup_temp) < 0 ||
virCgroupSetCpusetMems(cgroup_temp, nodeset_str) < 0)
goto cleanup;
virCgroupFree(&cgroup_temp);
virCgroupFree(cgroup_temp);
cgroup_temp = NULL;
}
/* set nodeset for root cgroup */
@ -8747,7 +8750,7 @@ qemuDomainSetNumaParamsLive(virDomainObjPtr vm,
ret = 0;
cleanup:
virCgroupFree(&cgroup_temp);
virCgroupFree(cgroup_temp);
return ret;
}
@ -9164,13 +9167,14 @@ qemuSetVcpusBWLive(virDomainObjPtr vm, virCgroupPtr cgroup,
if (qemuSetupCgroupVcpuBW(cgroup_vcpu, period, quota) < 0)
goto cleanup;
virCgroupFree(&cgroup_vcpu);
virCgroupFree(cgroup_vcpu);
cgroup_vcpu = NULL;
}
return 0;
cleanup:
virCgroupFree(&cgroup_vcpu);
virCgroupFree(cgroup_vcpu);
return -1;
}
@ -9191,11 +9195,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;
}
@ -9222,13 +9226,14 @@ qemuSetIOThreadsBWLive(virDomainObjPtr vm, virCgroupPtr cgroup,
if (qemuSetupCgroupVcpuBW(cgroup_iothread, period, quota) < 0)
goto cleanup;
virCgroupFree(&cgroup_iothread);
virCgroupFree(cgroup_iothread);
cgroup_iothread = NULL;
}
return 0;
cleanup:
virCgroupFree(&cgroup_iothread);
virCgroupFree(cgroup_iothread);
return -1;
}
@ -9601,7 +9606,7 @@ qemuGetVcpusBWLive(virDomainObjPtr vm,
ret = 0;
cleanup:
virCgroupFree(&cgroup_vcpu);
virCgroupFree(cgroup_vcpu);
return ret;
}
@ -9624,7 +9629,7 @@ qemuGetEmulatorBandwidthLive(virCgroupPtr cgroup,
ret = 0;
cleanup:
virCgroupFree(&cgroup_emulator);
virCgroupFree(cgroup_emulator);
return ret;
}
@ -9660,7 +9665,7 @@ qemuGetIOThreadsBWLive(virDomainObjPtr vm,
ret = 0;
cleanup:
virCgroupFree(&cgroup_iothread);
virCgroupFree(cgroup_iothread);
return ret;
}

View File

@ -2750,7 +2750,7 @@ qemuProcessSetupPid(virDomainObjPtr vm,
if (cgroup) {
if (ret < 0)
virCgroupRemove(cgroup);
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
}
return ret;

View File

@ -680,7 +680,7 @@ virCgroupNew(pid_t pid,
return 0;
error:
virCgroupFree(group);
virCgroupFree(*group);
*group = NULL;
return -1;
@ -860,9 +860,11 @@ virCgroupNewPartition(const char *path,
ret = 0;
cleanup:
if (ret != 0)
virCgroupFree(group);
virCgroupFree(&parent);
if (ret != 0) {
virCgroupFree(*group);
*group = NULL;
}
virCgroupFree(parent);
return ret;
}
@ -923,7 +925,8 @@ virCgroupNewDomainPartition(virCgroupPtr partition,
*/
if (virCgroupMakeGroup(partition, *group, create,
VIR_CGROUP_MEM_HIERACHY) < 0) {
virCgroupFree(group);
virCgroupFree(*group);
*group = NULL;
return -1;
}
@ -976,7 +979,8 @@ virCgroupNewThread(virCgroupPtr domain,
return -1;
if (virCgroupMakeGroup(domain, *group, create, VIR_CGROUP_THREAD) < 0) {
virCgroupFree(group);
virCgroupFree(*group);
*group = NULL;
return -1;
}
@ -1019,7 +1023,8 @@ virCgroupNewDetectMachine(const char *name,
machinename)) {
VIR_DEBUG("Failed to validate machine name for '%s' driver '%s'",
name, drivername);
virCgroupFree(group);
virCgroupFree(*group);
*group = NULL;
return 0;
}
}
@ -1059,13 +1064,13 @@ virCgroupEnableMissingControllers(char *path,
goto cleanup;
if (virCgroupMakeGroup(parent, tmp, true, VIR_CGROUP_SYSTEMD) < 0) {
virCgroupFree(&tmp);
virCgroupFree(tmp);
goto cleanup;
}
if (t) {
*t = '/';
offset = t;
virCgroupFree(&parent);
virCgroupFree(parent);
parent = tmp;
} else {
*group = tmp;
@ -1075,7 +1080,7 @@ virCgroupEnableMissingControllers(char *path,
ret = 0;
cleanup:
virCgroupFree(&parent);
virCgroupFree(parent);
return ret;
}
@ -1130,7 +1135,7 @@ virCgroupNewMachineSystemd(const char *name,
break;
}
}
virCgroupFree(&init);
virCgroupFree(init);
if (!path || STREQ(path, "/") || path[0] != '/') {
VIR_DEBUG("Systemd didn't setup its controller, path=%s",
@ -1148,7 +1153,8 @@ virCgroupNewMachineSystemd(const char *name,
virErrorPreserveLast(&saved);
virCgroupRemove(*group);
virCgroupFree(group);
virCgroupFree(*group);
*group = NULL;
virErrorRestore(&saved);
}
@ -1199,7 +1205,8 @@ virCgroupNewMachineManual(const char *name,
virErrorPreserveLast(&saved);
virCgroupRemove(*group);
virCgroupFree(group);
virCgroupFree(*group);
*group = NULL;
virErrorRestore(&saved);
}
@ -1207,7 +1214,7 @@ virCgroupNewMachineManual(const char *name,
ret = 0;
cleanup:
virCgroupFree(&parent);
virCgroupFree(parent);
return ret;
}
@ -2059,12 +2066,13 @@ virCgroupGetPercpuVcpuSum(virCgroupPtr group,
sum_cpu_time[j] += tmp;
}
virCgroupFree(&group_vcpu);
virCgroupFree(group_vcpu);
group_vcpu = NULL;
}
ret = 0;
cleanup:
virCgroupFree(&group_vcpu);
virCgroupFree(group_vcpu);
return ret;
}
@ -2556,7 +2564,8 @@ virCgroupKillRecursiveInternal(virCgroupPtr group,
if (dormdir)
virCgroupRemove(subgroup);
virCgroupFree(&subgroup);
virCgroupFree(subgroup);
subgroup = NULL;
}
if (direrr < 0)
goto cleanup;
@ -2565,7 +2574,7 @@ virCgroupKillRecursiveInternal(virCgroupPtr group,
ret = killedAny ? 1 : 0;
cleanup:
virCgroupFree(&subgroup);
virCgroupFree(subgroup);
VIR_DIR_CLOSE(dp);
return ret;
}
@ -2767,7 +2776,7 @@ virCgroupControllerAvailable(int controller)
return ret;
ret = virCgroupHasController(cgroup, controller);
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return ret;
}
@ -3534,24 +3543,24 @@ virCgroupControllerAvailable(int controller G_GNUC_UNUSED)
* @group: The group structure to free
*/
void
virCgroupFree(virCgroupPtr *group)
virCgroupFree(virCgroupPtr group)
{
size_t i;
if (*group == NULL)
if (group == NULL)
return;
for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
VIR_FREE((*group)->legacy[i].mountPoint);
VIR_FREE((*group)->legacy[i].linkPoint);
VIR_FREE((*group)->legacy[i].placement);
VIR_FREE(group->legacy[i].mountPoint);
VIR_FREE(group->legacy[i].linkPoint);
VIR_FREE(group->legacy[i].placement);
}
VIR_FREE((*group)->unified.mountPoint);
VIR_FREE((*group)->unified.placement);
VIR_FREE(group->unified.mountPoint);
VIR_FREE(group->unified.placement);
VIR_FREE((*group)->path);
VIR_FREE(*group);
VIR_FREE(group->path);
VIR_FREE(group);
}
@ -3568,7 +3577,7 @@ virCgroupDelThread(virCgroupPtr cgroup,
/* Remove the offlined cgroup */
virCgroupRemove(new_cgroup);
virCgroupFree(&new_cgroup);
virCgroupFree(new_cgroup);
}
return 0;

View File

@ -107,7 +107,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,

View File

@ -1484,7 +1484,7 @@ virCgroupV1MemoryOnceInit(void)
"memory.limit_in_bytes",
&mem_unlimited));
cleanup:
virCgroupFree(&group);
virCgroupFree(group);
virCgroupV1MemoryUnlimitedKB = mem_unlimited >> 10;
}

View File

@ -217,7 +217,7 @@ testCgroupDetectMounts(const void *args)
cleanup:
g_unsetenv("VIR_CGROUP_MOCK_FILENAME");
VIR_FREE(parsed);
virCgroupFree(&group);
virCgroupFree(group);
return result;
}
@ -245,7 +245,7 @@ static int testCgroupNewForSelf(const void *args G_GNUC_UNUSED)
ret = validateCgroup(cgroup, "", mountsFull, links, placement, NULL, NULL, 0);
cleanup:
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return ret;
}
@ -322,7 +322,7 @@ static int testCgroupNewForPartition(const void *args G_GNUC_UNUSED)
goto cleanup;
}
ret = validateCgroup(cgroup, "/virtualmachines.partition", mountsSmall, links, placementSmall, NULL, NULL, 0);
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
if ((rv = virCgroupNewPartition("/virtualmachines", true, -1, &cgroup)) != 0) {
fprintf(stderr, "Cannot create /virtualmachines cgroup: %d\n", -rv);
@ -331,7 +331,7 @@ static int testCgroupNewForPartition(const void *args G_GNUC_UNUSED)
ret = validateCgroup(cgroup, "/virtualmachines.partition", mountsFull, links, placementFull, NULL, NULL, 0);
cleanup:
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return ret;
}
@ -371,7 +371,7 @@ static int testCgroupNewForPartitionNested(const void *args G_GNUC_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;
@ -381,7 +381,7 @@ static int testCgroupNewForPartitionNested(const void *args G_GNUC_UNUSED)
mountsFull, links, placementFull, NULL, NULL, 0);
cleanup:
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return ret;
}
@ -420,14 +420,14 @@ static int testCgroupNewForPartitionNestedDeep(const void *args G_GNUC_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;
@ -437,7 +437,7 @@ static int testCgroupNewForPartitionNestedDeep(const void *args G_GNUC_UNUSED)
mountsFull, links, placementFull, NULL, NULL, 0);
cleanup:
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return ret;
}
@ -473,8 +473,8 @@ static int testCgroupNewForPartitionDomain(const void *args G_GNUC_UNUSED)
ret = validateCgroup(domaincgroup, "/production.partition/foo.libvirt-lxc", mountsFull, links, placement, NULL, NULL, 0);
cleanup:
virCgroupFree(&partitioncgroup);
virCgroupFree(&domaincgroup);
virCgroupFree(partitioncgroup);
virCgroupFree(domaincgroup);
return ret;
}
@ -524,10 +524,10 @@ static int testCgroupNewForPartitionDomainEscaped(const void *args G_GNUC_UNUSED
ret = validateCgroup(domaincgroup, "/_cgroup.evil/net_cls.evil/__evil.evil/_cpu.foo.libvirt-lxc", mountsFull, links, placement, NULL, NULL, 0);
cleanup:
virCgroupFree(&partitioncgroup3);
virCgroupFree(&partitioncgroup2);
virCgroupFree(&partitioncgroup1);
virCgroupFree(&domaincgroup);
virCgroupFree(partitioncgroup3);
virCgroupFree(partitioncgroup2);
virCgroupFree(partitioncgroup1);
virCgroupFree(domaincgroup);
return ret;
}
@ -553,7 +553,7 @@ static int testCgroupNewForSelfAllInOne(const void *args G_GNUC_UNUSED)
ret = validateCgroup(cgroup, "", mountsAllInOne, linksAllInOne, placement, NULL, NULL, 0);
cleanup:
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return ret;
}
@ -564,7 +564,7 @@ static int testCgroupNewForSelfLogind(const void *args G_GNUC_UNUSED)
if (virCgroupNewSelf(&cgroup) >= 0) {
fprintf(stderr, "Expected to fail, only systemd cgroup available.\n");
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return -1;
}
@ -592,7 +592,7 @@ static int testCgroupNewForSelfUnified(const void *args G_GNUC_UNUSED)
ret = validateCgroup(cgroup, "", empty, empty, empty,
"/not/really/sys/fs/cgroup", "/", controllers);
cleanup:
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return ret;
}
@ -630,7 +630,7 @@ static int testCgroupNewForSelfHybrid(const void *args G_GNUC_UNUSED)
"/not/really/sys/fs/cgroup/unified", "/", controllers);
cleanup:
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return ret;
}
@ -756,7 +756,7 @@ static int testCgroupGetPercpuStats(const void *args G_GNUC_UNUSED)
ret = 0;
cleanup:
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
VIR_FREE(params);
return ret;
}
@ -789,7 +789,7 @@ static int testCgroupGetMemoryUsage(const void *args G_GNUC_UNUSED)
ret = 0;
cleanup:
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return ret;
}
@ -849,7 +849,7 @@ testCgroupGetMemoryStat(const void *args G_GNUC_UNUSED)
ret = 0;
cleanup:
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return ret;
}
@ -900,7 +900,7 @@ static int testCgroupGetBlkioIoServiced(const void *args G_GNUC_UNUSED)
ret = 0;
cleanup:
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return ret;
}
@ -973,7 +973,7 @@ static int testCgroupGetBlkioIoDeviceServiced(const void *args G_GNUC_UNUSED)
ret = 0;
cleanup:
virCgroupFree(&cgroup);
virCgroupFree(cgroup);
return ret;
}

View File

@ -315,7 +315,7 @@ int virHostValidateCGroupControllers(const char *hvname,
}
}
virCgroupFree(&group);
virCgroupFree(group);
return ret;
}