vircgrouptest: call virCgroupNewSelf instead virCgroupDetectMounts

This will be required once cgroup v2 is introduced.  The cgroup
detection is not simple and we will have multiple backends so we
should not just jump into the middle of the detection code.

In order to use virCgroupNewSelf we need to create all the remaining
data files:

    - {name}.cgroups represents /proc/cgroups, it is a list of cgroup
      controllers compiled into kernel

    - {name}.self.cgroup represents /proc/self/cgroup, it describes
      cgroups to which the process belongs

For "no-cgroups" we need to modify the expected behavior because
virCgroupNewSelf() will fail if there are no controllers available.

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina
2018-09-14 13:17:07 +02:00
parent 4988f4b347
commit 8b62008d2b
25 changed files with 217 additions and 31 deletions

View File

@@ -0,0 +1,9 @@
#subsys_name hierarchy num_cgroups enabled
cpuset 0 1 1
cpu 1 1 1
cpuacct 2 1 1
blkio 7 1 1
memory 3 1 1
devices 4 1 1
freezer 5 1 1
net_cls 6 1 1