From: Christian Brauner Date: Wed, 17 Feb 2021 00:43:51 +0000 (+0100) Subject: start: delegate than move into the target cgroup X-Git-Tag: lxc-5.0.0~282^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=838d155694526ed2da3260f4255b10ccb5d85a46;p=thirdparty%2Flxc.git start: delegate than move into the target cgroup This is a way more sensible model. Signed-off-by: Christian Brauner --- diff --git a/src/lxc/start.c b/src/lxc/start.c index 466897dad..6bba836f5 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -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; }