confile: add clearer for lxc.console

parent c74cc490
...@@ -181,12 +181,13 @@ static int set_config_cap_keep(const char *, const char *, struct lxc_conf *); ...@@ -181,12 +181,13 @@ static int set_config_cap_keep(const char *, const char *, struct lxc_conf *);
static int get_config_cap_keep(const char *, char *, int, struct lxc_conf *); static int get_config_cap_keep(const char *, char *, int, struct lxc_conf *);
static int clr_config_cap_keep(const char *, struct lxc_conf *); static int clr_config_cap_keep(const char *, struct lxc_conf *);
static int set_config_console(const char *, const char *, struct lxc_conf *);
static int get_config_console(const char *, char *, int, struct lxc_conf *);
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 get_config_console_logfile(const char *, char *, int, struct lxc_conf *); static int get_config_console_logfile(const char *, char *, int, struct lxc_conf *);
static int set_config_console(const char *, const char *, struct lxc_conf *);
static int get_config_console(const char *, char *, int, struct lxc_conf *);
static int clr_config_console(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 get_config_seccomp(const char *, char *, int, struct lxc_conf *); static int get_config_seccomp(const char *, char *, int, struct lxc_conf *);
...@@ -290,7 +291,7 @@ static struct lxc_config_t config[] = { ...@@ -290,7 +291,7 @@ static struct lxc_config_t config[] = {
{ "lxc.cap.drop", set_config_cap_drop, get_config_cap_drop, clr_config_cap_drop, }, { "lxc.cap.drop", set_config_cap_drop, get_config_cap_drop, clr_config_cap_drop, },
{ "lxc.cap.keep", set_config_cap_keep, get_config_cap_keep, clr_config_cap_keep, }, { "lxc.cap.keep", set_config_cap_keep, get_config_cap_keep, clr_config_cap_keep, },
{ "lxc.console.logfile", set_config_console_logfile, get_config_console_logfile, NULL }, { "lxc.console.logfile", set_config_console_logfile, get_config_console_logfile, NULL },
{ "lxc.console", set_config_console, get_config_console, NULL }, { "lxc.console", set_config_console, get_config_console, clr_config_console, },
{ "lxc.seccomp", set_config_seccomp, get_config_seccomp, NULL }, { "lxc.seccomp", set_config_seccomp, get_config_seccomp, NULL },
{ "lxc.include", set_config_includefile, NULL, NULL }, { "lxc.include", set_config_includefile, NULL, NULL },
{ "lxc.autodev", set_config_autodev, get_config_autodev, NULL }, { "lxc.autodev", set_config_autodev, get_config_autodev, NULL },
...@@ -2791,10 +2792,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key) ...@@ -2791,10 +2792,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key)
free(c->console.log_path); free(c->console.log_path);
c->console.log_path = NULL; c->console.log_path = NULL;
} else if (strcmp(key, "lxc.console") == 0) {
free(c->console.path);
c->console.path = NULL;
} else if (strcmp(key, "lxc.autodev") == 0) { } else if (strcmp(key, "lxc.autodev") == 0) {
c->autodev = 1; c->autodev = 1;
...@@ -4178,3 +4175,11 @@ static inline int clr_config_cap_keep(const char *key, struct lxc_conf *c) ...@@ -4178,3 +4175,11 @@ static inline int clr_config_cap_keep(const char *key, struct lxc_conf *c)
{ {
return lxc_clear_config_keepcaps(c); return lxc_clear_config_keepcaps(c);
} }
static inline int clr_config_console(const char *key, struct lxc_conf *c)
{
free(c->console.path);
c->console.path = NULL;
return 0;
}
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