confile: add getter for lxc.console

parent b80927f2
...@@ -156,6 +156,8 @@ static int set_config_cap_keep(const char *, const char *, struct lxc_conf *); ...@@ -156,6 +156,8 @@ static int set_config_cap_keep(const char *, const char *, struct lxc_conf *);
static int get_config_cap_keep(struct lxc_container *, const char *, char *, int); static int get_config_cap_keep(struct lxc_container *, const char *, char *, int);
static int set_config_console(const char *, const char *, struct lxc_conf *); 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 set_config_console_logfile(const char *, const char *, struct lxc_conf *);
static int set_config_seccomp(const char *, const char *, struct lxc_conf *); 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_includefile(const char *, const char *, struct lxc_conf *);
...@@ -228,7 +230,7 @@ static struct lxc_config_t config[] = { ...@@ -228,7 +230,7 @@ static struct lxc_config_t config[] = {
{ "lxc.cap.drop", set_config_cap_drop, get_config_cap_drop, 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.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, NULL, NULL},
{ "lxc.console", set_config_console, NULL, NULL}, { "lxc.console", set_config_console, get_config_console, NULL},
{ "lxc.seccomp", set_config_seccomp, NULL, NULL}, { "lxc.seccomp", set_config_seccomp, NULL, NULL},
{ "lxc.include", set_config_includefile, NULL, NULL}, { "lxc.include", set_config_includefile, NULL, NULL},
{ "lxc.autodev", set_config_autodev, NULL, NULL}, { "lxc.autodev", set_config_autodev, NULL, NULL},
...@@ -2725,8 +2727,6 @@ int lxc_get_config_item(struct lxc_conf *c, const char *key, char *retv, ...@@ -2725,8 +2727,6 @@ int lxc_get_config_item(struct lxc_conf *c, const char *key, char *retv,
if (strcmp(key, "lxc.console.logfile") == 0) if (strcmp(key, "lxc.console.logfile") == 0)
v = c->console.log_path; v = c->console.log_path;
else if (strcmp(key, "lxc.console") == 0)
v = c->console.path;
else if (strcmp(key, "lxc.start.auto") == 0) else if (strcmp(key, "lxc.start.auto") == 0)
return lxc_get_conf_int(c, retv, inlen, c->start_auto); return lxc_get_conf_int(c, retv, inlen, c->start_auto);
else if (strcmp(key, "lxc.start.delay") == 0) else if (strcmp(key, "lxc.start.delay") == 0)
...@@ -3891,3 +3891,9 @@ static int get_config_cap_keep(struct lxc_container *c, const char *key, ...@@ -3891,3 +3891,9 @@ static int get_config_cap_keep(struct lxc_container *c, const char *key,
} }
return fulllen; return fulllen;
} }
static int get_config_console(struct lxc_container *c, const char *key,
char *retv, int inlen)
{
return lxc_get_conf_str(retv, inlen, c->lxc_conf->console.path);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment