]> git.ipfire.org Git - thirdparty/libvirt.git/commit
vircgroupv2: detect controllers enabled in parent cgroup
authorPavel Hrdina <phrdina@redhat.com>
Thu, 29 Oct 2020 15:05:20 +0000 (16:05 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Tue, 3 Nov 2020 20:26:32 +0000 (21:26 +0100)
commit9d312af35730782583424b9ef247012fbde9da41
tree50525365017239dc4a78907b19362de55d8ddde0
parent902c6644a8ec292789d561b3188e576c37a86872
vircgroupv2: detect controllers enabled in parent cgroup

With cgroups v2 working with controllers is a bit more complicated then
with cgroups v1 where the controller had to be mounted.

There are two files, cgroups.controllers and cgroup.subtree_control.
The file cgroup.controllers lists all controllers enabled in the current
cgroup and cgroups.subtree_control, as the name suggest, controls which
controllers are enabled for a subtree of cgroups.

Now the issue here is that the current code doesn't make any difference
if the @parent variable is NULL or not because ../cgroup.subtree_control
will list the same controllers as ./cgroup.controllers.

The whole point of the @parent variable is when we are building the
cgroup topology ourselves without systemd help we need to detect which
controllers are enabled in the parent cgroup in order to enable them for
the current cgroup as well and for that we need to check
cgroup.controllers of the parent group.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/vircgroupv2.c