]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: add clearer for lxc.ephemeral
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 31 May 2017 16:30:10 +0000 (18:30 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 31 May 2017 16:44:50 +0000 (18:44 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile.c

index 3774b1e6e47395359b317a4b32f010afb5055a8f..7a040aea970f1946550846733d99c21580756802 100644 (file)
@@ -242,6 +242,7 @@ static int clr_config_init_gid(const char *, struct lxc_conf *);
 
 static int set_config_ephemeral(const char *, const char *, struct lxc_conf *);
 static int get_config_ephemeral(const char *, char *, int, struct lxc_conf *);
+static int clr_config_ephemeral(const char *, struct lxc_conf *);
 
 static int set_config_syslog(const char *, const char *, struct lxc_conf *);
 static int get_config_syslog(const char *, char *, int, struct lxc_conf *);
@@ -321,7 +322,7 @@ static struct lxc_config_t config[] = {
        { "lxc.init_cmd",             set_config_init_cmd,             get_config_init_cmd,          clr_config_init_cmd,          },
        { "lxc.init_uid",             set_config_init_uid,             get_config_init_uid,          clr_config_init_uid,          },
        { "lxc.init_gid",             set_config_init_gid,             get_config_init_gid,          clr_config_init_gid,          },
-       { "lxc.ephemeral",            set_config_ephemeral,            get_config_ephemeral,         NULL },
+       { "lxc.ephemeral",            set_config_ephemeral,            get_config_ephemeral,         clr_config_ephemeral,         },
        { "lxc.syslog",               set_config_syslog,               get_config_syslog,            clr_config_syslog,            },
        { "lxc.no_new_privs",         set_config_no_new_privs,         get_config_no_new_privs,      NULL },
        { "lxc.limit",                set_config_limit,                get_config_limit,             NULL },
@@ -2774,9 +2775,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key)
        if (strncmp(key, "lxc.limit", 9) == 0) {
                ret = lxc_clear_limits(c, key);
 
-       } else if (strcmp(key, "lxc.ephemeral") == 0) {
-               c->ephemeral = 0;
-
        } else if (strcmp(key, "lxc.include") == 0) {
                lxc_clear_includes(c);
 
@@ -4237,3 +4235,9 @@ static inline int clr_config_init_gid(const char *key, struct lxc_conf *c)
        c->init_gid = 0;
        return 0;
 }
+
+static inline int clr_config_ephemeral(const char *key, struct lxc_conf *c)
+{
+       c->ephemeral = 0;
+       return 0;
+}