The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/8127

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From 79aca195c917f1ba851c9a4ae0b490e4d6e6de11 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Fri, 6 Nov 2020 17:33:45 -0500
Subject: [PATCH] lxd/cgroup: Fix V2 detection/handling
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/cgroup/init.go | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lxd/cgroup/init.go b/lxd/cgroup/init.go
index 8fa085a06f..732d4afa40 100644
--- a/lxd/cgroup/init.go
+++ b/lxd/cgroup/init.go
@@ -358,8 +358,10 @@ func init() {
 
                        scanControllers := bufio.NewScanner(controllers)
                        for scanControllers.Scan() {
-                               line := strings.TrimSpace(scanSelfCg.Text())
-                               unifiedControllers[line] = V2
+                               line := 
strings.TrimSpace(scanControllers.Text())
+                               for _, entry := range strings.Split(line, " ") {
+                                       unifiedControllers[entry] = V2
+                               }
                        }
                        hasV2 = true
 
@@ -411,11 +413,11 @@ func init() {
 
        val, ok = cgControllers["memory"]
        if ok && val == V2 {
-               if shared.PathExists("/sys/fs/cgroup/memory/memory.swap.max") {
+               if shared.PathExists("/sys/fs/cgroup/memory.swap.max") {
                        cgControllers["memory.swap.max"] = V2
                }
 
-               if 
shared.PathExists("/sys/fs/cgroup/memory/memory.swap.current") {
+               if shared.PathExists("/sys/fs/cgroup/memory.swap.current") {
                        cgControllers["memory.swap.current"] = V2
                }
        }
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to