]> xenbits.xensource.com Git - libvirt.git/commitdiff
Revert "lxc: controller: Fix container launch on cgroup v1"
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 10 Dec 2021 12:46:54 +0000 (13:46 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 10 Dec 2021 15:22:49 +0000 (16:22 +0100)
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 <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/lxc/lxc_controller.c

index 039efcd7c769e7958857d667ba7d59bfdc25836b..7c593ee3a91bc4de527e33ce81d5bcac61d0405d 100644 (file)
@@ -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 */