[lxc-devel] [lxc/master] cgroups: tweaks
brauner on Github
lxc-bot at linuxcontainers.org
Thu Sep 27 11:39:59 UTC 2018
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180927/a7ed5c08/attachment.bin>
-------------- next part --------------
From 529822a46fe6afef439f640c4fd4cc4e11dc6551 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Thu, 27 Sep 2018 13:35:34 +0200
Subject: [PATCH 1/2] cgfsng: log cgroup names for monitor and container
Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
src/lxc/cgroups/cgfsng.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c
index ca8ce0a7f..629d371ec 100644
--- a/src/lxc/cgroups/cgfsng.c
+++ b/src/lxc/cgroups/cgfsng.c
@@ -1376,8 +1376,10 @@ __cgfsng_ops static inline bool cgfsng_monitor_create(struct cgroup_ops *ops,
}
} while (ops->hierarchies[i] && idx > 0 && idx < 1000);
- if (idx < 1000)
+ if (idx < 1000) {
bret = true;
+ INFO("The monitor process uses \"%s\" as cgroup", monitor_cgroup);
+ }
on_error:
free(monitor_cgroup);
@@ -1454,6 +1456,7 @@ __cgfsng_ops static inline bool cgfsng_payload_create(struct cgroup_ops *ops,
}
ops->container_cgroup = container_cgroup;
+ INFO("The container uses \"%s\" as cgroup", container_cgroup);
return true;
From 4394ea17cbec9355b5789f15767f906772e93a7a Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Thu, 27 Sep 2018 13:36:17 +0200
Subject: [PATCH 2/2] cgroup: make monitor_pattern const
Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
src/lxc/cgroups/cgroup.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lxc/cgroups/cgroup.h b/src/lxc/cgroups/cgroup.h
index 976883a3c..d4dcd506b 100644
--- a/src/lxc/cgroups/cgroup.h
+++ b/src/lxc/cgroups/cgroup.h
@@ -102,7 +102,7 @@ struct cgroup_ops {
char *container_cgroup;
/* Static memory, do not free.*/
- char *monitor_pattern;
+ const char *monitor_pattern;
/* @hierarchies
* - A NULL-terminated array of struct hierarchy, one per legacy
More information about the lxc-devel
mailing list