Unverified Commit 36421187 by Christian Brauner Committed by Stéphane Graber

confile: add clearer for lxc.logfile

parent bb6cde84
...@@ -100,6 +100,7 @@ static int clr_config_loglevel(const char *, struct lxc_conf *); ...@@ -100,6 +100,7 @@ static int clr_config_loglevel(const char *, struct lxc_conf *);
static int set_config_logfile(const char *, const char *, struct lxc_conf *); static int set_config_logfile(const char *, const char *, struct lxc_conf *);
static int get_config_logfile(const char *, char *, int, struct lxc_conf *); static int get_config_logfile(const char *, char *, int, struct lxc_conf *);
static int clr_config_logfile(const char *, struct lxc_conf *);
static int set_config_mount(const char *, const char *, struct lxc_conf *); static int set_config_mount(const char *, const char *, struct lxc_conf *);
static int get_config_mount(const char *, char *, int, struct lxc_conf *); static int get_config_mount(const char *, char *, int, struct lxc_conf *);
...@@ -217,7 +218,7 @@ static struct lxc_config_t config[] = { ...@@ -217,7 +218,7 @@ static struct lxc_config_t config[] = {
{ "lxc.cgroup", set_config_cgroup, get_config_cgroup, clr_config_cgroup, }, { "lxc.cgroup", set_config_cgroup, get_config_cgroup, clr_config_cgroup, },
{ "lxc.id_map", set_config_idmaps, get_config_idmaps, clr_config_idmaps, }, { "lxc.id_map", set_config_idmaps, get_config_idmaps, clr_config_idmaps, },
{ "lxc.loglevel", set_config_loglevel, get_config_loglevel, clr_config_loglevel, }, { "lxc.loglevel", set_config_loglevel, get_config_loglevel, clr_config_loglevel, },
{ "lxc.logfile", set_config_logfile, get_config_logfile, NULL }, { "lxc.logfile", set_config_logfile, get_config_logfile, clr_config_logfile, },
{ "lxc.mount.entry", set_config_mount, get_config_mount, NULL }, { "lxc.mount.entry", set_config_mount, get_config_mount, NULL },
{ "lxc.mount.auto", set_config_mount_auto, get_config_mount_auto, NULL }, { "lxc.mount.auto", set_config_mount_auto, get_config_mount_auto, NULL },
{ "lxc.mount", set_config_fstab, get_config_fstab, NULL }, { "lxc.mount", set_config_fstab, get_config_fstab, NULL },
...@@ -2625,10 +2626,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key) ...@@ -2625,10 +2626,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key)
free(c->seccomp); free(c->seccomp);
c->seccomp = NULL; c->seccomp = NULL;
} else if (strcmp(key, "lxc.logfile") == 0) {
free(c->logfile);
c->logfile = NULL;
} else if (strcmp(key, "lxc.monitor.unshare") == 0) { } else if (strcmp(key, "lxc.monitor.unshare") == 0) {
c->monitor_unshare = 0; c->monitor_unshare = 0;
...@@ -3777,3 +3774,10 @@ static inline int clr_config_loglevel(const char *key, struct lxc_conf *c) ...@@ -3777,3 +3774,10 @@ static inline int clr_config_loglevel(const char *key, struct lxc_conf *c)
c->loglevel = LXC_LOG_PRIORITY_NOTSET; c->loglevel = LXC_LOG_PRIORITY_NOTSET;
return 0; return 0;
} }
static inline int clr_config_logfile(const char *key, struct lxc_conf *c)
{
free(c->logfile);
c->logfile = 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