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

confile: add getter for lxc.ephemeral

parent da2bb1b8
......@@ -192,6 +192,7 @@ static int set_config_init_gid(const char *, const char *, struct lxc_conf *);
static int get_config_init_gid(struct lxc_container *, const char *, char *, int);
static int set_config_ephemeral(const char *, const char *, struct lxc_conf *);
static int get_config_ephemeral(struct lxc_container *, const char *, char *, int);
static struct lxc_config_t config[] = {
{ "lxc.arch", set_config_personality, get_config_personality, NULL},
......@@ -261,7 +262,7 @@ static struct lxc_config_t config[] = {
{ "lxc.init_cmd", set_config_init_cmd, get_config_init_cmd, NULL},
{ "lxc.init_uid", set_config_init_uid, get_config_init_uid, NULL},
{ "lxc.init_gid", set_config_init_gid, get_config_init_gid, NULL},
{ "lxc.ephemeral", set_config_ephemeral, NULL, NULL},
{ "lxc.ephemeral", set_config_ephemeral, get_config_ephemeral, NULL},
};
struct signame {
......@@ -2481,17 +2482,7 @@ static inline int lxc_get_conf_int(struct lxc_conf *c, char *retv, int inlen,
int lxc_get_config_item(struct lxc_conf *c, const char *key, char *retv,
int inlen)
{
const char *v = NULL;
if (strcmp(key, "lxc.ephemeral") == 0)
return lxc_get_conf_int(c, retv, inlen, c->ephemeral);
else return -1;
if (!v)
return 0;
if (retv && inlen >= strlen(v) + 1)
strncpy(retv, v, strlen(v)+1);
return strlen(v);
return 0;
}
int lxc_clear_config_item(struct lxc_conf *c, const char *key)
......@@ -3676,3 +3667,10 @@ static int get_config_init_gid(struct lxc_container *c, const char *key,
return lxc_get_conf_int(c->lxc_conf, retv, inlen,
c->lxc_conf->init_gid);
}
static int get_config_ephemeral(struct lxc_container *c, const char *key,
char *retv, int inlen)
{
return lxc_get_conf_int(c->lxc_conf, retv, inlen,
c->lxc_conf->ephemeral);
}
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