]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups: pass handler to cgroup mount() method
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 15 Feb 2021 10:57:31 +0000 (11:57 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 15 Feb 2021 10:57:31 +0000 (11:57 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c
src/lxc/cgroups/cgroup.h
src/lxc/conf.c

index 6917441596239de9f8b6b60338163c1625bc0830..d5883351b6562c08854e3ed6f653129dd2b75320 100644 (file)
@@ -1867,11 +1867,12 @@ static inline int cg_mount_cgroup_full(int type, struct hierarchy *h,
 }
 
 __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
-                                     struct lxc_conf *conf, int type)
+                                     struct lxc_handler *handler, int type)
 {
        __do_close int dfd_mnt_cgroupfs = -EBADF, fd_fs = -EBADF;
        __do_free char *cgroup_root = NULL;
        bool has_cgns = false, wants_force_mount = false;
+       struct lxc_conf *conf = handler->conf;
        struct lxc_rootfs *rootfs = &conf->rootfs;
        const char *rootfs_mnt = get_rootfs_mnt(rootfs);
        int ret;
index f8de2b17f7d7963d6dfb7244e17d18a42d5ab125..67c52e509173fa4aacf974e4eb989b8314988779 100644 (file)
@@ -172,7 +172,7 @@ struct cgroup_ops {
        bool (*chown)(struct cgroup_ops *ops, struct lxc_conf *conf);
        bool (*attach)(struct cgroup_ops *ops, const struct lxc_conf *conf,
                       const char *name, const char *lxcpath, pid_t pid);
-       bool (*mount)(struct cgroup_ops *ops, struct lxc_conf *conf, int type);
+       bool (*mount)(struct cgroup_ops *ops, struct lxc_handler *handler, int type);
        bool (*devices_activate)(struct cgroup_ops *ops,
                                 struct lxc_handler *handler);
        bool (*monitor_delegate_controllers)(struct cgroup_ops *ops);
index 1758252f677d982bd02ae16862c678eee273b473..78f3f01b38a72fe041e5dd423ac13a147c62ef5e 100644 (file)
@@ -704,7 +704,7 @@ static int lxc_mount_auto_mounts(struct lxc_handler *handler, int flags)
                if (flags & LXC_AUTO_CGROUP_FORCE)
                        cg_flags |= LXC_AUTO_CGROUP_FORCE;
 
-               if (!handler->cgroup_ops->mount(handler->cgroup_ops, conf, cg_flags))
+               if (!handler->cgroup_ops->mount(handler->cgroup_ops, handler, cg_flags))
                        return log_error_errno(-1, errno, "Failed to mount \"/sys/fs/cgroup\"");
        }