Unverified Commit 1bb08049 by Christian Brauner Committed by Stéphane Graber

cgroups: initialize lxc.pivot cpuset

Closes: #3443. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 5d2ce0b6
...@@ -1082,6 +1082,7 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops, ...@@ -1082,6 +1082,7 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
for (int i = 0; ops->hierarchies[i]; i++) { for (int i = 0; ops->hierarchies[i]; i++) {
__do_free char *pivot_path = NULL; __do_free char *pivot_path = NULL;
struct hierarchy *h = ops->hierarchies[i]; struct hierarchy *h = ops->hierarchies[i];
size_t offset;
int ret; int ret;
if (!h->monitor_full_path) if (!h->monitor_full_path)
...@@ -1094,20 +1095,20 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops, ...@@ -1094,20 +1095,20 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
} }
if (conf && conf->cgroup_meta.monitor_dir) if (conf && conf->cgroup_meta.monitor_dir)
pivot_path = must_make_path(h->mountpoint, pivot_path = must_make_path(h->mountpoint, h->container_base_path,
h->container_base_path, conf->cgroup_meta.monitor_dir, CGROUP_PIVOT, NULL);
conf->cgroup_meta.monitor_dir,
CGROUP_PIVOT, NULL);
else if (conf && conf->cgroup_meta.dir) else if (conf && conf->cgroup_meta.dir)
pivot_path = must_make_path(h->mountpoint, pivot_path = must_make_path(h->mountpoint, h->container_base_path,
h->container_base_path, conf->cgroup_meta.dir, CGROUP_PIVOT, NULL);
conf->cgroup_meta.dir,
CGROUP_PIVOT, NULL);
else else
pivot_path = must_make_path(h->mountpoint, pivot_path = must_make_path(h->mountpoint, h->container_base_path,
h->container_base_path,
CGROUP_PIVOT, NULL); CGROUP_PIVOT, NULL);
offset = strlen(h->mountpoint) + strlen(h->container_base_path);
if (cg_legacy_handle_cpuset_hierarchy(h, pivot_path + offset))
SYSWARN("Failed to initialize cpuset %s/" CGROUP_PIVOT, pivot_path);
ret = mkdir_p(pivot_path, 0755); ret = mkdir_p(pivot_path, 0755);
if (ret < 0 && errno != EEXIST) { if (ret < 0 && errno != EEXIST) {
ERROR("Failed to create %s", pivot_path); ERROR("Failed to create %s", pivot_path);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment