2
0
mirror of git://github.com/lxc/lxc synced 2025-08-31 21:29:27 +00:00

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 <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner
2017-08-25 11:51:05 +02:00
parent a17f8b3f46
commit 7d531e9ba4

View File

@@ -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) {