mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Revert "util: cgroups do not implicitly add task to new machine cgroup"
This reverts commit 71ce475967
.
Since commit id 'a41c00b47' has been reverted, this no longer is
necessary
This commit is contained in:
parent
f8f6907284
commit
d41bd09596
@ -504,17 +504,6 @@ virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def,
|
|||||||
&cgroup) < 0 || !cgroup)
|
&cgroup) < 0 || !cgroup)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virCgroupAddTask(cgroup, initpid) < 0) {
|
|
||||||
virErrorPtr saved = virSaveLastError();
|
|
||||||
virCgroupRemove(cgroup);
|
|
||||||
virCgroupFree(&cgroup);
|
|
||||||
if (saved) {
|
|
||||||
virSetError(saved);
|
|
||||||
virFreeError(saved);
|
|
||||||
}
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* setup control group permissions for user namespace */
|
/* setup control group permissions for user namespace */
|
||||||
if (def->idmap.uidmap) {
|
if (def->idmap.uidmap) {
|
||||||
if (virCgroupSetOwner(cgroup,
|
if (virCgroupSetOwner(cgroup,
|
||||||
|
@ -789,17 +789,6 @@ qemuInitCgroup(virQEMUDriverPtr driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virCgroupAddTask(priv->cgroup, vm->pid) < 0) {
|
|
||||||
virErrorPtr saved = virSaveLastError();
|
|
||||||
virCgroupRemove(priv->cgroup);
|
|
||||||
virCgroupFree(&priv->cgroup);
|
|
||||||
if (saved) {
|
|
||||||
virSetError(saved);
|
|
||||||
virFreeError(saved);
|
|
||||||
}
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
|
@ -1669,6 +1669,16 @@ virCgroupNewMachineSystemd(const char *name,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (virCgroupAddTask(*group, pidleader) < 0) {
|
||||||
|
virErrorPtr saved = virSaveLastError();
|
||||||
|
virCgroupRemove(*group);
|
||||||
|
virCgroupFree(group);
|
||||||
|
if (saved) {
|
||||||
|
virSetError(saved);
|
||||||
|
virFreeError(saved);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virCgroupFree(&parent);
|
virCgroupFree(&parent);
|
||||||
@ -1691,6 +1701,7 @@ int virCgroupTerminateMachine(const char *name,
|
|||||||
static int
|
static int
|
||||||
virCgroupNewMachineManual(const char *name,
|
virCgroupNewMachineManual(const char *name,
|
||||||
const char *drivername,
|
const char *drivername,
|
||||||
|
pid_t pidleader,
|
||||||
const char *partition,
|
const char *partition,
|
||||||
int controllers,
|
int controllers,
|
||||||
virCgroupPtr *group)
|
virCgroupPtr *group)
|
||||||
@ -1716,6 +1727,16 @@ virCgroupNewMachineManual(const char *name,
|
|||||||
group) < 0)
|
group) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (virCgroupAddTask(*group, pidleader) < 0) {
|
||||||
|
virErrorPtr saved = virSaveLastError();
|
||||||
|
virCgroupRemove(*group);
|
||||||
|
virCgroupFree(group);
|
||||||
|
if (saved) {
|
||||||
|
virSetError(saved);
|
||||||
|
virFreeError(saved);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@ -1762,6 +1783,7 @@ virCgroupNewMachine(const char *name,
|
|||||||
|
|
||||||
return virCgroupNewMachineManual(name,
|
return virCgroupNewMachineManual(name,
|
||||||
drivername,
|
drivername,
|
||||||
|
pidleader,
|
||||||
partition,
|
partition,
|
||||||
controllers,
|
controllers,
|
||||||
group);
|
group);
|
||||||
|
Loading…
Reference in New Issue
Block a user