From 4231f35a444f32cbf418e6b84760aeedb00587a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Je=C5=99=C3=A1bek?= Date: Fri, 5 Nov 2021 17:56:45 +0100 Subject: [PATCH] fix: support FreezerController in cgroups v2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #60 Signed-off-by: Martin Jeřábek --- src/hierarchies.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hierarchies.rs b/src/hierarchies.rs index 0cd2e0e..92cc94c 100644 --- a/src/hierarchies.rs +++ b/src/hierarchies.rs @@ -202,7 +202,12 @@ impl Hierarchy for V2 { let mut subs = vec![]; let controllers = ret.unwrap().trim().to_string(); - let controller_list: Vec<&str> = controllers.split(' ').collect(); + let mut controller_list: Vec<&str> = controllers.split(' ').collect(); + + // The freezer functionality is present in V2, but not as a controller, + // but apparently as a core functionality. FreezerController supports + // that, but we must explicitly fake the controller here. + controller_list.push("freezer"); for s in controller_list { match s {