Unverified Commit 66d5e280 by Christian Brauner Committed by Stéphane Graber

confile: add clearer for lxc.personality

parent a0f70df6
...@@ -56,6 +56,7 @@ lxc_log_define(lxc_confile, lxc); ...@@ -56,6 +56,7 @@ lxc_log_define(lxc_confile, lxc);
static int set_config_personality(const char *, const char *, struct lxc_conf *); static int set_config_personality(const char *, const char *, struct lxc_conf *);
static int get_config_personality(const char *, char *, int, struct lxc_conf *); static int get_config_personality(const char *, char *, int, struct lxc_conf *);
static int clr_config_personality(const char *, struct lxc_conf *);
static int set_config_pts(const char *, const char *, struct lxc_conf *); static int set_config_pts(const char *, const char *, struct lxc_conf *);
static int get_config_pts(const char *, char *, int, struct lxc_conf *); static int get_config_pts(const char *, char *, int, struct lxc_conf *);
...@@ -195,7 +196,7 @@ static int set_config_ephemeral(const char *, const char *, struct lxc_conf *); ...@@ -195,7 +196,7 @@ static int set_config_ephemeral(const char *, const char *, struct lxc_conf *);
static int get_config_ephemeral(const char *, char *, int, struct lxc_conf *); static int get_config_ephemeral(const char *, char *, int, struct lxc_conf *);
static struct lxc_config_t config[] = { static struct lxc_config_t config[] = {
{ "lxc.arch", set_config_personality, get_config_personality, NULL }, { "lxc.arch", set_config_personality, get_config_personality, clr_config_personality, },
{ "lxc.pts", set_config_pts, get_config_pts, NULL }, { "lxc.pts", set_config_pts, get_config_pts, NULL },
{ "lxc.tty", set_config_tty, get_config_tty, NULL }, { "lxc.tty", set_config_tty, get_config_tty, NULL },
{ "lxc.devttydir", set_config_ttydir, get_config_ttydir, NULL }, { "lxc.devttydir", set_config_ttydir, get_config_ttydir, NULL },
...@@ -2563,9 +2564,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key) ...@@ -2563,9 +2564,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key)
free(c->utsname); free(c->utsname);
c->utsname = NULL; c->utsname = NULL;
} else if (strcmp(key, "lxc.arch") == 0) {
c->personality = -1;
} else if (strcmp(key, "lxc.haltsignal") == 0) { } else if (strcmp(key, "lxc.haltsignal") == 0) {
c->haltsignal = 0; c->haltsignal = 0;
...@@ -3733,3 +3731,10 @@ static int get_config_ephemeral(const char *key, char *retv, int inlen, ...@@ -3733,3 +3731,10 @@ static int get_config_ephemeral(const char *key, char *retv, int inlen,
{ {
return lxc_get_conf_int(c, retv, inlen, c->ephemeral); return lxc_get_conf_int(c, retv, inlen, c->ephemeral);
} }
/* Callbacks to clear config items. */
static inline int clr_config_personality(const char *key, struct lxc_conf *c)
{
c->personality = -1;
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