static int get_config_pivotdir(struct lxc_container *, const char *, char *, int);
static int set_config_utsname(const char *, const char *, struct lxc_conf *);
+static int get_config_utsname(struct lxc_container *, const char *, char *, int);
+
static int set_config_hook(const char *, const char *, struct lxc_conf *lxc_conf);
static int set_config_network(const char *, const char *, struct lxc_conf *);
static int set_config_network_type(const char *, const char *, struct lxc_conf *);
{ "lxc.rootfs.backend", set_config_rootfs_backend, get_config_rootfs_backend, NULL},
{ "lxc.rootfs", set_config_rootfs, get_config_rootfs, NULL},
{ "lxc.pivotdir", set_config_pivotdir, get_config_pivotdir, NULL},
- { "lxc.utsname", set_config_utsname, NULL, NULL},
+ { "lxc.utsname", set_config_utsname, get_config_utsname, NULL},
{ "lxc.hook.pre-start", set_config_hook, NULL, NULL},
{ "lxc.hook.pre-mount", set_config_hook, NULL, NULL},
{ "lxc.hook.mount", set_config_hook, NULL, NULL},
{
const char *v = NULL;
- if (strcmp(key, "lxc.utsname") == 0)
- v = c->utsname ? c->utsname->nodename : NULL;
- else if (strcmp(key, "lxc.console.logfile") == 0)
+ if (strcmp(key, "lxc.console.logfile") == 0)
v = c->console.log_path;
else if (strcmp(key, "lxc.console") == 0)
v = c->console.path;
{
return 0;
}
+
+static int get_config_utsname(struct lxc_container *c, const char *key,
+ char *retv, int inlen)
+{
+ return lxc_get_conf_str(
+ retv, inlen,
+ c->lxc_conf->utsname ? c->lxc_conf->utsname->nodename : NULL);
+}