From 5abd9049c8bdea6170dc455033e37811ba875db8 Mon Sep 17 00:00:00 2001
Message-Id: <5abd9049c8bdea6170dc455033e37811ba875db8@dist-git>
From: Pavel Hrdina <phrdina@redhat.com>
Date: Mon, 1 Jul 2019 17:06:13 +0200
Subject: [PATCH] vircgroup: fix bug in virCgroupEnableMissingControllers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
(cherry picked from commit 63b4ed0dd3e1555b4c9d82ef0ca0648493f75af2)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1689297
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Message-Id: <ae150854a6a02300cd3329c538373b770320f504.1561993099.git.phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@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 6aa30a82be..2328957818 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -1495,7 +1495,7 @@ virCgroupEnableMissingControllers(char *path,
int ret = -1;
if (virCgroupNew(pidleader,
- "",
+ "/",
NULL,
controllers,
&parent) < 0)
--
2.22.0