Skip to content

Commit

Permalink
confile: add getter for lxc.haltsignal
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 authored and stgraber committed Jul 16, 2017
1 parent 2dfd528 commit 16fb828
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/lxc/confile.c
Expand Up @@ -162,6 +162,8 @@ static int set_config_autodev(const char *, const char *, struct lxc_conf *);
static int get_config_autodev(struct lxc_container *, const char *, char *, int);

static int set_config_haltsignal(const char *, const char *, struct lxc_conf *);
static int get_config_haltsignal(struct lxc_container *, const char *, char *, int);

static int set_config_rebootsignal(const char *, const char *, struct lxc_conf *);
static int set_config_stopsignal(const char *, const char *, struct lxc_conf *);
static int set_config_start(const char *, const char *, struct lxc_conf *);
Expand Down Expand Up @@ -229,7 +231,7 @@ static struct lxc_config_t config[] = {
{ "lxc.seccomp", set_config_seccomp, get_config_seccomp, NULL},
{ "lxc.include", set_config_includefile, NULL, NULL},
{ "lxc.autodev", set_config_autodev, get_config_autodev, NULL},
{ "lxc.haltsignal", set_config_haltsignal, NULL, NULL},
{ "lxc.haltsignal", set_config_haltsignal, get_config_haltsignal, NULL},
{ "lxc.rebootsignal", set_config_rebootsignal, NULL, NULL},
{ "lxc.stopsignal", set_config_stopsignal, NULL, NULL},
{ "lxc.start.auto", set_config_start, NULL, NULL},
Expand Down Expand Up @@ -2515,8 +2517,6 @@ int lxc_get_config_item(struct lxc_conf *c, const char *key, char *retv,
return lxc_get_conf_int(c, retv, inlen, c->init_gid);
else if (strcmp(key, "lxc.ephemeral") == 0)
return lxc_get_conf_int(c, retv, inlen, c->ephemeral);
else if (strcmp(key, "lxc.haltsignal") == 0)
return lxc_get_conf_int(c, retv, inlen, c->haltsignal);
else if (strcmp(key, "lxc.rebootsignal") == 0)
return lxc_get_conf_int(c, retv, inlen, c->rebootsignal);
else if (strcmp(key, "lxc.stopsignal") == 0)
Expand Down Expand Up @@ -3614,3 +3614,10 @@ static int get_config_autodev(struct lxc_container *c, const char *key,
{
return lxc_get_conf_int(c->lxc_conf, retv, inlen, c->lxc_conf->autodev);
}

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

0 comments on commit 16fb828

Please sign in to comment.