Skip to content

Commit

Permalink
confile: add getter for lxc.kmsg
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed May 31, 2017
1 parent 8015e01 commit de1ede6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/lxc/confile.c
Expand Up @@ -77,6 +77,8 @@ static int set_config_ttydir(const char *, const char *, struct lxc_conf *);
static int get_config_ttydir(struct lxc_container *, const char *, char *, int);

static int set_config_kmsg(const char *, const char *, struct lxc_conf *);
static int get_config_kmsg(struct lxc_container *, const char *, char *, int);

static int set_config_lsm_aa_profile(const char *, const char *, struct lxc_conf *);
static int set_config_lsm_aa_incomplete(const char *, const char *, struct lxc_conf *);
static int set_config_lsm_se_context(const char *, const char *, struct lxc_conf *);
Expand Down Expand Up @@ -138,7 +140,7 @@ static struct lxc_config_t config[] = {
{ "lxc.pts", set_config_pts, get_config_pts, NULL},
{ "lxc.tty", set_config_tty, get_config_tty, NULL},
{ "lxc.devttydir", set_config_ttydir, get_config_ttydir, NULL},
{ "lxc.kmsg", set_config_kmsg, NULL, NULL},
{ "lxc.kmsg", set_config_kmsg, get_config_kmsg, NULL},
{ "lxc.aa_profile", set_config_lsm_aa_profile, NULL, NULL},
{ "lxc.aa_allow_incomplete", set_config_lsm_aa_incomplete, NULL, NULL},
{ "lxc.se_context", set_config_lsm_se_context, NULL, NULL},
Expand Down Expand Up @@ -3090,8 +3092,6 @@ int lxc_get_config_item(struct lxc_conf *c, const char *key, char *retv,
return lxc_get_conf_int(c, retv, inlen, c->stopsignal);
else if (strcmp(key, "lxc.autodev") == 0)
return lxc_get_conf_int(c, retv, inlen, c->autodev);
else if (strcmp(key, "lxc.kmsg") == 0)
return lxc_get_conf_int(c, retv, inlen, c->kmsg);
else return -1;

if (!v)
Expand Down Expand Up @@ -3724,3 +3724,9 @@ static int get_config_ttydir(struct lxc_container *c, const char *key,
{
return lxc_get_conf_str(retv, inlen, c->lxc_conf->ttydir);
}

static int get_config_kmsg(struct lxc_container *c, const char *key, char *retv,
int inlen)
{
return lxc_get_conf_int(c->lxc_conf, retv, inlen, c->lxc_conf->kmsg);
}

0 comments on commit de1ede6

Please sign in to comment.