Skip to content

Commit

Permalink
criu: warn about cgroup hierarchies without controllers
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 10, 2021
1 parent 2539492 commit 92fde26
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/lxc/criu.c
Expand Up @@ -324,11 +324,16 @@ static int exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf,
return log_error_errno(-ENOMEM, ENOMEM, "Failed to remove extraneous slashes from \"%s\"", tmp);
free_move_ptr(cgroup_base_path, tmp);

controllers = lxc_string_join(",", (const char **)controllers_list, false);
if (!controllers)
return log_error_errno(-ENOMEM, ENOMEM, "Failed to join controllers");
if (controllers_list[0]) {
controllers = lxc_string_join(",", (const char **)controllers_list, false);
if (!controllers)
return log_error_errno(-ENOMEM, ENOMEM, "Failed to join controllers");

ret = sprintf(buf, "%s:%s", controllers, cgroup_base_path);
ret = sprintf(buf, "%s:%s", controllers, cgroup_base_path);
} else {
WARN("No cgroup controllers configured in container's cgroup %s", cgroup_base_path);
ret = sprintf(buf, "%s", cgroup_base_path);
}
if (ret < 0 || ret >= sizeof(buf))
return log_error_errno(-EIO, EIO, "sprintf of cgroup root arg failed");

Expand Down

0 comments on commit 92fde26

Please sign in to comment.