mirror of
git://github.com/lxc/lxc
synced 2025-09-04 18:05:17 +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:
@@ -1345,11 +1345,11 @@ static void remove_path_for_hierarchy(struct hierarchy *h, char *cgname)
|
|||||||
*/
|
*/
|
||||||
static inline bool cgfsng_create(void *hdata)
|
static inline bool cgfsng_create(void *hdata)
|
||||||
{
|
{
|
||||||
struct cgfsng_handler_data *d = hdata;
|
|
||||||
char *tmp, *cgname, *offset;
|
|
||||||
int i;
|
int i;
|
||||||
int idx = 0;
|
|
||||||
size_t len;
|
size_t len;
|
||||||
|
char *cgname, *offset, *tmp;
|
||||||
|
int idx = 0;
|
||||||
|
struct cgfsng_handler_data *d = hdata;
|
||||||
|
|
||||||
if (!d)
|
if (!d)
|
||||||
return false;
|
return false;
|
||||||
@@ -1360,7 +1360,7 @@ static inline bool cgfsng_create(void *hdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (d->cgroup_meta.dir)
|
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
|
else
|
||||||
tmp = lxc_string_replace("%n", d->name, d->cgroup_pattern);
|
tmp = lxc_string_replace("%n", d->name, d->cgroup_pattern);
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
|
Reference in New Issue
Block a user