From: Christian Brauner Date: Fri, 25 Aug 2017 09:51:05 +0000 (+0200) Subject: cgfsng: add container name to lxc.cgroup.dir value X-Git-Tag: lxc-2.1.0~14^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d531e9ba482947eaf9be3b19949f24b5e78bb44;p=thirdparty%2Flxc.git cgfsng: add container name to lxc.cgroup.dir value Say we have lxc.uts.name = c1 lxc.cgroup.dir = lxd the actual path should be lxd/c1 Right now it would just be lxd Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index e137b33c0..fe3fd7062 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1345,11 +1345,11 @@ static void remove_path_for_hierarchy(struct hierarchy *h, char *cgname) */ static inline bool cgfsng_create(void *hdata) { - struct cgfsng_handler_data *d = hdata; - char *tmp, *cgname, *offset; int i; - int idx = 0; size_t len; + char *cgname, *offset, *tmp; + int idx = 0; + struct cgfsng_handler_data *d = hdata; if (!d) return false; @@ -1360,7 +1360,7 @@ static inline bool cgfsng_create(void *hdata) } if (d->cgroup_meta.dir) - tmp = strdup(d->cgroup_meta.dir); + tmp = lxc_string_join("/", (const char *[]){d->cgroup_meta.dir, d->name, NULL}, false); else tmp = lxc_string_replace("%n", d->name, d->cgroup_pattern); if (!tmp) {