[libvirt] [PATCH v2 2/9] vircgroup: fix bug in virCgroupEnableMissingControllers

Pavel Hrdina phrdina at redhat.com
Thu Sep 20 08:54:31 UTC 2018


If we are on host with systemd we need to build cgroup hierarchy
ourselves for controllers that are not managed by systemd.

As a starting parent we need to force root group because
virCgroupMakeGroup() takes that parent in order to inherit values
for cpuset controller.

By default cpuset controller is managed by systemd so we will never
hit the issue but for v2 cgroups we need to use parent cgroup every
time.

Reviewed-by: Fabiano Fidêncio <fidencio at redhat.com>
Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 src/util/vircgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index f9e387c86d..13f5e0d83a 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -1491,7 +1491,7 @@ virCgroupEnableMissingControllers(char *path,
     int ret = -1;
 
     if (virCgroupNew(pidleader,
-                     "",
+                     "/",
                      NULL,
                      controllers,
                      &parent) < 0)
-- 
2.17.1




More information about the libvir-list mailing list