]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: add getter for lxc.haltsignal
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 31 May 2017 06:47:28 +0000 (08:47 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 31 May 2017 08:03:32 +0000 (10:03 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile.c

index 2da4f7412ac27962ba914febe4a665635d1622c9..371aad9bf3a825a7bd50bd3299ade08c4e5a9feb 100644 (file)
@@ -171,6 +171,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 *);
@@ -241,7 +243,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},
@@ -2760,8 +2762,6 @@ int lxc_get_config_item(struct lxc_conf *c, const char *key, char *retv,
                return lxc_get_limit_entry(c, retv, inlen, "all");
        else if (strncmp(key, "lxc.limit.", 10) == 0) // specific limit
                return lxc_get_limit_entry(c, retv, inlen, key + 10);
-       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)
@@ -3916,3 +3916,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);
+}