]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: add getter for lxc.monitor.unshare
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 31 May 2017 07:07:02 +0000 (09:07 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 31 May 2017 08:03:33 +0000 (10:03 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile.c

index ee68f1f685f601fa75a28f369903f6d85013313c..e731c5a900aaced5e0d4ac199a20b735ecf77d21 100644 (file)
@@ -186,6 +186,8 @@ static int set_config_syslog(const char *, const char *, struct lxc_conf *);
 static int get_config_syslog(struct lxc_container *, const char *, char *, int);
 
 static int set_config_monitor(const char *, const char *, struct lxc_conf *);
+static int get_config_monitor(struct lxc_container *, const char *, char *, int);
+
 static int set_config_group(const char *, const char *, struct lxc_conf *);
 static int set_config_environment(const char *, const char *, struct lxc_conf *);
 static int set_config_init_cmd(const char *, const char *, struct lxc_conf *);
@@ -257,7 +259,7 @@ static struct lxc_config_t config[] = {
        { "lxc.start.auto",           set_config_start,                get_config_start,             NULL},
        { "lxc.start.delay",          set_config_start,                get_config_start,             NULL},
        { "lxc.start.order",          set_config_start,                get_config_start,             NULL},
-       { "lxc.monitor.unshare",      set_config_monitor,               NULL, NULL},
+       { "lxc.monitor.unshare",      set_config_monitor,              get_config_monitor,           NULL},
        { "lxc.group",                set_config_group,                 NULL, NULL},
        { "lxc.environment",          set_config_environment,           NULL, NULL},
        { "lxc.init_cmd",             set_config_init_cmd,              NULL, NULL},
@@ -2742,9 +2744,7 @@ int lxc_get_config_item(struct lxc_conf *c, const char *key, char *retv,
 {
        const char *v = NULL;
 
-       if (strcmp(key, "lxc.monitor.unshare") == 0)
-               return lxc_get_conf_int(c, retv, inlen, c->monitor_unshare);
-       else if (strcmp(key, "lxc.group") == 0)
+       if (strcmp(key, "lxc.group") == 0)
                return lxc_get_item_groups(c, retv, inlen);
        else if (strcmp(key, "lxc.environment") == 0)
                return lxc_get_item_environment(c, retv, inlen);
@@ -3965,3 +3965,10 @@ static int get_config_syslog(struct lxc_container *c, const char *key,
 {
        return lxc_get_conf_str(retv, inlen, c->lxc_conf->syslog);
 }
+
+static int get_config_monitor(struct lxc_container *c, const char *key,
+                             char *retv, int inlen)
+{
+       return lxc_get_conf_int(c->lxc_conf, retv, inlen,
+                               c->lxc_conf->monitor_unshare);
+}