]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: add clearer for lxc.rootfs.backend
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 31 May 2017 15:50:59 +0000 (17:50 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 31 May 2017 15:50:59 +0000 (17:50 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile.c

index fc46f57d3ac34f5a816449b7b189b65667fd220c..4ea94eedd3de91dc954a52cdac385d6591162ab0 100644 (file)
@@ -133,6 +133,7 @@ static int clr_config_rootfs_options(const char *, struct lxc_conf *);
 
 static int set_config_rootfs_backend(const char *, const char *, struct lxc_conf *);
 static int get_config_rootfs_backend(const char *, char *, int, struct lxc_conf *);
+static int clr_config_rootfs_backend(const char *, struct lxc_conf *);
 
 static int set_config_rootfs(const char *, const char *, struct lxc_conf *);
 static int get_config_rootfs(const char *, char *, int, struct lxc_conf *);
@@ -248,7 +249,7 @@ static struct lxc_config_t config[] = {
        { "lxc.mount",                set_config_fstab,                get_config_fstab,             clr_config_fstab,             },
        { "lxc.rootfs.mount",         set_config_rootfs_mount,         get_config_rootfs_mount,      clr_config_rootfs_mount,      },
        { "lxc.rootfs.options",       set_config_rootfs_options,       get_config_rootfs_options,    clr_config_rootfs_options,    },
-       { "lxc.rootfs.backend",       set_config_rootfs_backend,       get_config_rootfs_backend,    NULL },
+       { "lxc.rootfs.backend",       set_config_rootfs_backend,       get_config_rootfs_backend,    clr_config_rootfs_backend,    },
        { "lxc.rootfs",               set_config_rootfs,               get_config_rootfs,            clr_config_rootfs,            },
        { "lxc.pivotdir",             set_config_pivotdir,             get_config_pivotdir,          NULL },
        { "lxc.utsname",              set_config_utsname,              get_config_utsname,           NULL },
@@ -2809,10 +2810,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key)
        } else if (strcmp(key, "lxc.autodev") == 0) {
                c->autodev = 1;
 
-       } else if (strcmp(key, "lxc.rootfs.backend") == 0) {
-               free(c->rootfs.bdev_type);
-               c->rootfs.bdev_type = NULL;
-
        } else if (strcmp(key, "lxc.seccomp") == 0) {
                free(c->seccomp);
                c->seccomp = NULL;
@@ -4149,3 +4146,11 @@ static inline int clr_config_rootfs_options(const char *key, struct lxc_conf *c)
        c->rootfs.options = NULL;
        return 0;
 }
+
+static inline int clr_config_rootfs_backend(const char *key, struct lxc_conf *c)
+{
+       free(c->rootfs.bdev_type);
+       c->rootfs.bdev_type = NULL;
+       return 0;
+}
+