From: Christian Brauner Date: Wed, 31 May 2017 15:49:39 +0000 (+0200) Subject: confile: add clearer for lxc.rootfs.options X-Git-Tag: lxc-2.1.0~110^2~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b1eb67de13f61e135db936b494bd296529d88cf;p=thirdparty%2Flxc.git confile: add clearer for lxc.rootfs.options Signed-off-by: Christian Brauner --- diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 61d969b78..fc46f57d3 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -129,6 +129,7 @@ static int clr_config_rootfs_mount(const char *, struct lxc_conf *); static int set_config_rootfs_options(const char *, const char *, struct lxc_conf *); static int get_config_rootfs_options(const char *, char *, int, struct lxc_conf *); +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 *); @@ -246,7 +247,7 @@ static struct lxc_config_t config[] = { { "lxc.mount.auto", set_config_mount_auto, get_config_mount_auto, clr_config_mount_auto, }, { "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, NULL }, + { "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", set_config_rootfs, get_config_rootfs, clr_config_rootfs, }, { "lxc.pivotdir", set_config_pivotdir, get_config_pivotdir, NULL }, @@ -2808,10 +2809,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.options") == 0) { - free(c->rootfs.options); - c->rootfs.options = NULL; - } else if (strcmp(key, "lxc.rootfs.backend") == 0) { free(c->rootfs.bdev_type); c->rootfs.bdev_type = NULL; @@ -4145,3 +4142,10 @@ static inline int clr_config_rootfs_mount(const char *key, struct lxc_conf *c) c->rootfs.mount = NULL; return 0; } + +static inline int clr_config_rootfs_options(const char *key, struct lxc_conf *c) +{ + free(c->rootfs.options); + c->rootfs.options = NULL; + return 0; +}