]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
criu: handle new cgroup layout 3663/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 10 Feb 2021 12:21:25 +0000 (13:21 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 10 Feb 2021 12:36:04 +0000 (13:36 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/criu.c

index 20a4a3ec7f9a22642617d9e2941fab498dc6038d..562aab57aca329beeb57139d7d11eedf1c2c13df 100644 (file)
@@ -887,6 +887,7 @@ static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_
        struct lxc_handler *handler;
        int status = 0;
        int pipes[2] = {-1, -1};
+       struct cgroup_ops *cgroup_ops;
 
        /* Try to detach from the current controlling tty if it exists.
         * Otherwise, lxc_init (via lxc_console) will attach the container's
@@ -907,9 +908,25 @@ static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_
 
        if (lxc_init(c->name, handler) < 0)
                goto out;
+       cgroup_ops = handler->cgroup_ops;
 
-       if (!handler->cgroup_ops->payload_create(handler->cgroup_ops, handler)) {
-               ERROR("failed creating groups");
+       if (!cgroup_ops->monitor_create(cgroup_ops, handler)) {
+               ERROR("Failed to create monitor cgroup");
+               goto out_fini_handler;
+       }
+
+       if (!cgroup_ops->monitor_enter(cgroup_ops, handler)) {
+               ERROR("Failed to enter monitor cgroup");
+               goto out_fini_handler;
+       }
+
+       if (!cgroup_ops->monitor_delegate_controllers(cgroup_ops)) {
+               ERROR("Failed to delegate controllers to monitor cgroup");
+               goto out_fini_handler;
+       }
+
+       if (!cgroup_ops->payload_create(cgroup_ops, handler)) {
+               ERROR("Failed creating cgroups");
                goto out_fini_handler;
        }