]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: don't pass conf separately to lxc_mount_auto_mounts()
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 15 Feb 2021 10:55:33 +0000 (11:55 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 15 Feb 2021 10:55:33 +0000 (11:55 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c

index 6c3ed66a89149802fd54a71ad00f1f7900c61746..1758252f677d982bd02ae16862c678eee273b473 100644 (file)
@@ -564,7 +564,7 @@ static int add_shmount_to_list(struct lxc_conf *conf)
        return add_elem_to_mount_list(new_mount, conf);
 }
 
-static int lxc_mount_auto_mounts(struct lxc_conf *conf, int flags, struct lxc_handler *handler)
+static int lxc_mount_auto_mounts(struct lxc_handler *handler, int flags)
 {
        int i, ret;
        static struct {
@@ -608,6 +608,7 @@ static int lxc_mount_auto_mounts(struct lxc_conf *conf, int flags, struct lxc_ha
                { LXC_AUTO_SYS_MASK,  LXC_AUTO_SYS_MIXED,  NULL,                                             "%r/sys/devices/virtual/net", NULL,    MS_REMOUNT|MS_BIND|MS_NOSUID|MS_NODEV|MS_NOEXEC, NULL, false },
                { 0,                  0,                   NULL,                                             NULL,                         NULL,    0,                                               NULL, false }
        };
+       struct lxc_conf *conf = handler->conf;
         struct lxc_rootfs *rootfs = &conf->rootfs;
         bool has_cap_net_admin;
 
@@ -3432,7 +3433,7 @@ int lxc_setup(struct lxc_handler *handler)
        /* Do automatic mounts (mainly /proc and /sys), but exclude those that
         * need to wait until other stuff has finished.
         */
-       ret = lxc_mount_auto_mounts(lxc_conf, lxc_conf->auto_mounts & ~LXC_AUTO_CGROUP_MASK, handler);
+       ret = lxc_mount_auto_mounts(handler, lxc_conf->auto_mounts & ~LXC_AUTO_CGROUP_MASK);
        if (ret < 0)
                return log_error(-1, "Failed to setup first automatic mounts");
 
@@ -3473,7 +3474,7 @@ int lxc_setup(struct lxc_handler *handler)
         * mounted. It is guaranteed to be mounted now either through
         * automatically or via fstab entries.
         */
-       ret = lxc_mount_auto_mounts(lxc_conf, lxc_conf->auto_mounts & LXC_AUTO_CGROUP_MASK, handler);
+       ret = lxc_mount_auto_mounts(handler, lxc_conf->auto_mounts & LXC_AUTO_CGROUP_MASK);
        if (ret < 0)
                return log_error(-1, "Failed to setup remaining automatic mounts");