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

index 801a6b3d89ce5c41cf29c8035740fb5d16c79743..e54a68bcabf26bd85d97ca31e6239882c719c2ed 100644 (file)
@@ -81,6 +81,7 @@ static int clr_config_ttydir(const char *, struct lxc_conf *);
 
 static int set_config_kmsg(const char *, const char *, struct lxc_conf *);
 static int get_config_kmsg(const char *, char *, int, struct lxc_conf *);
+static int clr_config_kmsg(const char *, struct lxc_conf *);
 
 static int set_config_lsm_aa_profile(const char *, const char *, struct lxc_conf *);
 static int get_config_lsm_aa_profile(const char *, char *, int, struct lxc_conf *);
@@ -221,7 +222,7 @@ static struct lxc_config_t config[] = {
        { "lxc.pts",                  set_config_pts,                  get_config_pts,               clr_config_pts, },
        { "lxc.tty",                  set_config_tty,                  get_config_tty,               clr_config_tty, },
        { "lxc.devttydir",            set_config_ttydir,               get_config_ttydir,            clr_config_ttydir, },
-       { "lxc.kmsg",                 set_config_kmsg,                 get_config_kmsg,              NULL },
+       { "lxc.kmsg",                 set_config_kmsg,                 get_config_kmsg,              clr_config_kmsg, },
        { "lxc.aa_profile",           set_config_lsm_aa_profile,       get_config_lsm_aa_profile,    NULL },
        { "lxc.aa_allow_incomplete",  set_config_lsm_aa_incomplete,    get_config_lsm_aa_incomplete, NULL },
        { "lxc.se_context",           set_config_lsm_se_context,       get_config_lsm_se_context,    NULL },
@@ -2807,9 +2808,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.kmsg") == 0) {
-               c->kmsg = 0;
-
        } else if (strcmp(key, "lxc.mount") == 0) {
                free(c->fstab);
                c->fstab = NULL;
@@ -4096,3 +4094,9 @@ static inline int clr_config_ttydir(const char *key, struct lxc_conf *c)
        c->ttydir = NULL;
        return 0;
 }
+
+static inline int clr_config_kmsg(const char *key, struct lxc_conf *c)
+{
+       c->kmsg = 0;
+       return 0;
+}