summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorDan Streetman <ddstreet@canonical.com>2021-10-13 13:43:14 +0200
committerLennart Poettering <lennart@poettering.net>2021-10-14 14:57:49 +0200
commita69f1dd9ca2a8eb20bf75083a4199c8791d55bf8 (patch)
tree7cab5236f5ac9bc97458b070eea36668911101a5 /src/shared
parentvirt: Support detection for ARM64 Hyper-V guests (diff)
downloadsystemd-a69f1dd9ca2a8eb20bf75083a4199c8791d55bf8.tar.xz
systemd-a69f1dd9ca2a8eb20bf75083a4199c8791d55bf8.zip
cgroup: when checking for legacy controllers, ignore any we don't care about
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/cgroup-setup.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/shared/cgroup-setup.c b/src/shared/cgroup-setup.c
index aa5ee99ebf..2221fd07c2 100644
--- a/src/shared/cgroup-setup.c
+++ b/src/shared/cgroup-setup.c
@@ -63,6 +63,10 @@ static int cg_any_controller_used_for_v1(void) {
if (streq(enabled, "0"))
continue;
+ /* Ignore controllers we don't care about. */
+ if (cgroup_controller_from_string(name) < 0)
+ continue;
+
/* Since the unified cgroup doesn't use multiple hierarchies, if any controller has a
* non-zero hierarchy_id that means it's in use already in a legacy (or hybrid) cgroup v1
* hierarchy, and can't be used in a unified cgroup. */