start: delegate than move into the target cgroup

This is a way more sensible model. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 95ab26af
......@@ -1806,13 +1806,13 @@ static int lxc_spawn(struct lxc_handler *handler)
goto out_delete_net;
}
if (!cgroup_ops->payload_enter(cgroup_ops, handler)) {
ERROR("Failed to enter cgroups");
if (!cgroup_ops->payload_delegate_controllers(cgroup_ops)) {
ERROR("Failed to delegate controllers to payload cgroup");
goto out_delete_net;
}
if (!cgroup_ops->payload_delegate_controllers(cgroup_ops)) {
ERROR("Failed to delegate controllers to payload cgroup");
if (!cgroup_ops->payload_enter(cgroup_ops, handler)) {
ERROR("Failed to enter cgroups");
goto out_delete_net;
}
......@@ -2027,14 +2027,14 @@ int __lxc_start(struct lxc_handler *handler, struct lxc_operations *ops,
goto out_abort;
}
if (!cgroup_ops->monitor_enter(cgroup_ops, handler)) {
ERROR("Failed to enter monitor cgroup");
if (!cgroup_ops->monitor_delegate_controllers(cgroup_ops)) {
ERROR("Failed to delegate controllers to monitor cgroup");
ret = -1;
goto out_abort;
}
if (!cgroup_ops->monitor_delegate_controllers(cgroup_ops)) {
ERROR("Failed to delegate controllers to monitor cgroup");
if (!cgroup_ops->monitor_enter(cgroup_ops, handler)) {
ERROR("Failed to enter monitor cgroup");
ret = -1;
goto out_abort;
}
......
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