Skip to content

Commit

Permalink
cgfsng: check whether we have a conf
Browse files Browse the repository at this point in the history
We can't rely in general on the presence of an initialized conf on cgroup init
time. One good example are our criu codepaths.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner authored and stgraber committed Oct 4, 2017
1 parent 7620805 commit 9bd0222
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lxc/cgroups/cgfsng.c
Expand Up @@ -1175,8 +1175,10 @@ static void *cgfsng_init(struct lxc_handler *handler)
d->name = must_copy_string(handler->name);

/* copy per-container cgroup information */
d->cgroup_meta.dir = must_copy_string(handler->conf->cgroup_meta.dir);
d->cgroup_meta.controllers = must_copy_string(handler->conf->cgroup_meta.controllers);
if (handler->conf) {
d->cgroup_meta.dir = must_copy_string(handler->conf->cgroup_meta.dir);
d->cgroup_meta.controllers = must_copy_string(handler->conf->cgroup_meta.controllers);
}

/* copy system-wide cgroup information */
cgroup_pattern = lxc_global_config_value("lxc.cgroup.pattern");
Expand Down

0 comments on commit 9bd0222

Please sign in to comment.