summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-04-22 17:26:06 -0300
committerLennart Poettering <lennart@poettering.net>2013-04-22 23:14:12 -0300
commitaff38e74bd776471f15ba54b305a24b0251eb865 (patch)
tree3cf5b2d30d78cd2f7472907d098e298b52683e2e /src/shared
parentdc2c75602dc9f2529e6ba6db02fa53d057ce0f8c (diff)
nspawn: suffix the nspawn cgroups with ".nspawn"
As discussed with Dan Berrange it's a good idea to suffix all objects in the cgroup tree with ".something", so that when the system is partitioned using a resource management tool we can drop objects of different types into the same partition directory without generate namespace conflicts. We'l add this to the Pax Control Group document as soon as write access to the fdo wiki is restored.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/cgroup-util.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c
index 5d44342bbe..e54b94658c 100644
--- a/src/shared/cgroup-util.c
+++ b/src/shared/cgroup-util.c
@@ -1320,7 +1320,7 @@ int cg_pid_get_user_unit(pid_t pid, char **unit) {
int cg_path_get_machine_name(const char *path, char **machine) {
const char *e, *n;
- char *s;
+ char *s, *dot;
assert(path);
assert(machine);
@@ -1337,6 +1337,10 @@ int cg_path_get_machine_name(const char *path, char **machine) {
if (!s)
return -ENOMEM;
+ dot = strrchr(s, '.');
+ if (dot)
+ *dot = 0;
+
*machine = s;
return 0;
}