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

index 9d9da0c6f95edfd81c3d10dd65c6c18a503a97e0..0f4aae851ca38ab2fcaed6f91bf7a498c33c1533 100644 (file)
@@ -98,6 +98,8 @@ static int set_config_loglevel(const char *, const char *, struct lxc_conf *);
 static int get_config_loglevel(struct lxc_container *, const char *, char *, int);
 
 static int set_config_logfile(const char *, const char *, struct lxc_conf *);
+static int get_config_logfile(struct lxc_container *, const char *, char *, int);
+
 static int set_config_mount(const char *, const char *, struct lxc_conf *);
 static int set_config_mount_auto(const char *, const char *, struct lxc_conf *);
 static int set_config_fstab(const char *, const char *, struct lxc_conf *);
@@ -159,7 +161,7 @@ static struct lxc_config_t config[] = {
        { "lxc.cgroup",               set_config_cgroup,               get_config_cgroup,            NULL},
        { "lxc.id_map",               set_config_idmaps,               get_config_idmaps,            NULL},
        { "lxc.loglevel",             set_config_loglevel,             get_config_loglevel,          NULL},
-       { "lxc.logfile",              set_config_logfile,               NULL, NULL},
+       { "lxc.logfile",              set_config_logfile,              get_config_logfile,           NULL},
        { "lxc.mount.entry",          set_config_mount,                 NULL, NULL},
        { "lxc.mount.auto",           set_config_mount_auto,            NULL, NULL},
        { "lxc.mount",                set_config_fstab,                 NULL, NULL},
@@ -2944,8 +2946,6 @@ int lxc_get_config_item(struct lxc_conf *c, const char *key, char *retv,
                return lxc_get_auto_mounts(c, retv, inlen);
        else if (strcmp(key, "lxc.mount") == 0)
                v = c->fstab;
-       else if (strcmp(key, "lxc.logfile") == 0)
-               v = c->logfile;
        else if (strcmp(key, "lxc.utsname") == 0)
                v = c->utsname ? c->utsname->nodename : NULL;
        else if (strcmp(key, "lxc.console.logfile") == 0)
@@ -3763,3 +3763,9 @@ static int get_config_loglevel(struct lxc_container *c, const char *key,
        v = lxc_log_priority_to_string(c->lxc_conf->loglevel);
        return lxc_get_conf_str(retv, inlen, v);
 }
+
+static int get_config_logfile(struct lxc_container *c, const char *key,
+                             char *retv, int inlen)
+{
+       return lxc_get_conf_str(retv, inlen, c->lxc_conf->logfile);
+}