From b4fa13cdb5ee6d74baeac4bc07729280de811722 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Wed, 31 May 2017 15:18:00 +0200 Subject: [PATCH] confile: add clearer for lxc.mount.entry Signed-off-by: Christian Brauner --- src/lxc/confile.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lxc/confile.c b/src/lxc/confile.c index e2b619cba..26ea626a7 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -113,6 +113,7 @@ static int clr_config_logfile(const char *, struct lxc_conf *); static int set_config_mount(const char *, const char *, struct lxc_conf *); static int get_config_mount(const char *, char *, int, struct lxc_conf *); +static int clr_config_mount(const char *, struct lxc_conf *); static int set_config_mount_auto(const char *, const char *, struct lxc_conf *); static int get_config_mount_auto(const char *, char *, int, struct lxc_conf *); @@ -237,7 +238,7 @@ static struct lxc_config_t config[] = { { "lxc.id_map", set_config_idmaps, get_config_idmaps, clr_config_idmaps, }, { "lxc.loglevel", set_config_loglevel, get_config_loglevel, clr_config_loglevel, }, { "lxc.logfile", set_config_logfile, get_config_logfile, clr_config_logfile, }, - { "lxc.mount.entry", set_config_mount, get_config_mount, NULL }, + { "lxc.mount.entry", set_config_mount, get_config_mount, clr_config_mount, }, { "lxc.mount.auto", set_config_mount_auto, get_config_mount_auto, NULL }, { "lxc.mount", set_config_fstab, get_config_fstab, NULL }, { "lxc.rootfs.mount", set_config_rootfs_mount, get_config_rootfs_mount, NULL }, @@ -2754,9 +2755,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key) } else if (strcmp(key, "lxc.cap.keep") == 0) { ret = lxc_clear_config_keepcaps(c); - } else if (strcmp(key, "lxc.mount.entry") == 0) { - ret = lxc_clear_mount_entries(c); - } else if (strcmp(key, "lxc.mount.auto") == 0) { ret = lxc_clear_automounts(c); @@ -4127,3 +4125,8 @@ static inline int clr_config_logfile(const char *key, struct lxc_conf *c) c->logfile = NULL; return 0; } + +static inline int clr_config_mount(const char *key, struct lxc_conf *c) +{ + return lxc_clear_mount_entries(c); +}