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

index efdc347d3c205fc3d1cb1b53b4de5bc69582eedc..d111db91a2760da89466e27986e2fc7df9f34c56 100644 (file)
@@ -159,6 +159,8 @@ static int set_config_console(const char *, const char *, struct lxc_conf *);
 static int get_config_console(struct lxc_container *, const char *, char *, int);
 
 static int set_config_console_logfile(const char *, const char *, struct lxc_conf *);
+static int get_config_console_logfile(struct lxc_container *, const char *, char *, int);
+
 static int set_config_seccomp(const char *, const char *, struct lxc_conf *);
 static int set_config_includefile(const char *, const char *, struct lxc_conf *);
 static int set_config_network_nic(const char *, const char *, struct lxc_conf *);
@@ -229,7 +231,7 @@ static struct lxc_config_t config[] = {
        { "lxc.network",              set_config_network,              get_config_network,           NULL},
        { "lxc.cap.drop",             set_config_cap_drop,             get_config_cap_drop,          NULL},
        { "lxc.cap.keep",             set_config_cap_keep,             get_config_cap_keep,          NULL},
-       { "lxc.console.logfile",      set_config_console_logfile,       NULL, NULL},
+       { "lxc.console.logfile",      set_config_console_logfile,      get_config_console_logfile,   NULL},
        { "lxc.console",              set_config_console,              get_config_console,           NULL},
        { "lxc.seccomp",              set_config_seccomp,               NULL, NULL},
        { "lxc.include",              set_config_includefile,           NULL, NULL},
@@ -2725,9 +2727,7 @@ int lxc_get_config_item(struct lxc_conf *c, const char *key, char *retv,
 {
        const char *v = NULL;
 
-       if (strcmp(key, "lxc.console.logfile") == 0)
-               v = c->console.log_path;
-       else if (strcmp(key, "lxc.start.auto") == 0)
+       if (strcmp(key, "lxc.start.auto") == 0)
                return lxc_get_conf_int(c, retv, inlen, c->start_auto);
        else if (strcmp(key, "lxc.start.delay") == 0)
                return lxc_get_conf_int(c, retv, inlen, c->start_delay);
@@ -3897,3 +3897,9 @@ static int get_config_console(struct lxc_container *c, const char *key,
 {
        return lxc_get_conf_str(retv, inlen, c->lxc_conf->console.path);
 }
+
+static int get_config_console_logfile(struct lxc_container *c, const char *key,
+                                     char *retv, int inlen)
+{
+       return lxc_get_conf_str(retv, inlen, c->lxc_conf->console.log_path);
+}