From: Michal Privoznik Date: Fri, 10 Dec 2021 12:46:54 +0000 (+0100) Subject: Revert "lxc: controller: Fix container launch on cgroup v1" X-Git-Tag: v8.0.0-rc1~329 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ca80bfa1180a0bd83b4bb2d324bce60fb82dbdb;p=thirdparty%2Flibvirt.git Revert "lxc: controller: Fix container launch on cgroup v1" Unfortunately, this fix breakes machinectl in a very nasty way, for instance 'machinectl shell' drops into the host shell. It's worse than being unable to start a container with CGroupsV1. Revert until a proper fix is figured out. This reverts commit 1b9ce05ce241a581d4e80228c92ceb0266f21f94. References: https://gitlab.com/libvirt/libvirt/-/issues/182 Signed-off-by: Michal Privoznik Reviewed-by: Pavel Hrdina --- diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 039efcd7c7..7c593ee3a9 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -865,12 +865,12 @@ static int virLXCControllerSetupCgroupLimits(virLXCController *ctrl) nodeset = virDomainNumatuneGetNodeset(ctrl->def->numa, auto_nodeset, -1); if (!(ctrl->cgroup = virLXCCgroupCreate(ctrl->def, - getpid(), + ctrl->initpid, ctrl->nnicindexes, ctrl->nicindexes))) goto cleanup; - if (virCgroupAddMachineProcess(ctrl->cgroup, ctrl->initpid) < 0) + if (virCgroupAddMachineProcess(ctrl->cgroup, getpid()) < 0) goto cleanup; /* Add all qemu-nbd tasks to the cgroup */