From aff38e74bd776471f15ba54b305a24b0251eb865 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 22 Apr 2013 17:26:06 -0300 Subject: 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. --- src/shared/cgroup-util.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/shared/cgroup-util.c') 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; } -- cgit v1.2.3-54-g00ecf