Commit 2b425d51 by Stéphane Graber

Rename all lxc.conf options to lxc.<key>

This is a first step in bringing the lxc.conf configfile in line with the container's format. Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent d7768b90
......@@ -25,6 +25,6 @@ bindir=@BINDIR@
templatedir=@LXCTEMPLATEDIR@
lxcinitdir=@LXCINITDIR@
lxc_path=`lxc-config lxcpath`
lxc_vg=`lxc-config lvm_vg`
lxc_zfsroot=`lxc-config zfsroot`
lxc_path=`lxc-config lxc.lxcpath`
lxc_vg=`lxc-config lxc.lvm_vg`
lxc_zfsroot=`lxc-config lxc.zfsroot`
......@@ -32,10 +32,10 @@ struct lxc_config_items {
static struct lxc_config_items items[] =
{
{ .name = "lxcpath", .fn = &lxc_get_default_config_path, },
{ .name = "lvm_vg", .fn = &lxc_get_default_lvm_vg, },
{ .name = "lvm_thin_pool", .fn = &lxc_get_default_lvm_thin_pool, },
{ .name = "zfsroot", .fn = &lxc_get_default_zfs_root, },
{ .name = "lxc.lxcpath", .fn = &lxc_get_default_config_path, },
{ .name = "lxc.lvm_vg", .fn = &lxc_get_default_lvm_vg, },
{ .name = "lxc.lvm_thin_pool", .fn = &lxc_get_default_lvm_thin_pool, },
{ .name = "lxc.zfsroot", .fn = &lxc_get_default_zfs_root, },
{ .name = NULL, },
};
......
......@@ -241,12 +241,12 @@ static char *copy_global_config_value(char *p)
static const char *lxc_global_config_value(const char *option_name)
{
static const char * const options[][2] = {
{ "lvm_vg", DEFAULT_VG },
{ "lvm_thin_pool", DEFAULT_THIN_POOL },
{ "zfsroot", DEFAULT_ZFSROOT },
{ "lxcpath", NULL },
{ "cgroup.pattern", DEFAULT_CGROUP_PATTERN },
{ "cgroup.use", NULL },
{ "lxc.lvm_vg", DEFAULT_VG },
{ "lxc.lvm_thin_pool", DEFAULT_THIN_POOL },
{ "lxc.zfsroot", DEFAULT_ZFSROOT },
{ "lxc.lxcpath", NULL },
{ "lxc.cgroup.pattern", DEFAULT_CGROUP_PATTERN },
{ "lxc.cgroup.use", NULL },
{ NULL, NULL },
};
......@@ -337,7 +337,7 @@ static const char *lxc_global_config_value(const char *option_name)
}
}
/* could not find value, use default */
if (strcmp(option_name, "lxcpath") == 0)
if (strcmp(option_name, "lxc.lxcpath") == 0)
values[i] = user_lxc_path;
else {
free(user_lxc_path);
......@@ -358,32 +358,32 @@ out:
const char *default_lvm_vg(void)
{
return lxc_global_config_value("lvm_vg");
return lxc_global_config_value("lxc.lvm_vg");
}
const char *default_lvm_thin_pool(void)
{
return lxc_global_config_value("lvm_thin_pool");
return lxc_global_config_value("lxc.lvm_thin_pool");
}
const char *default_zfs_root(void)
{
return lxc_global_config_value("zfsroot");
return lxc_global_config_value("lxc.zfsroot");
}
const char *default_lxc_path(void)
{
return lxc_global_config_value("lxcpath");
return lxc_global_config_value("lxc.lxcpath");
}
const char *default_cgroup_use(void)
{
return lxc_global_config_value("cgroup.use");
return lxc_global_config_value("lxc.cgroup.use");
}
const char *default_cgroup_pattern(void)
{
return lxc_global_config_value("cgroup.pattern");
return lxc_global_config_value("lxc.cgroup.pattern");
}
const char *get_rundir()
......
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