Skip to content

Commit

Permalink
Rename all lxc.conf options to lxc.<key>
Browse files Browse the repository at this point in the history
This is a first step in bringing the lxc.conf configfile in line with
the container's format.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information
stgraber committed Jan 10, 2014
1 parent d7768b9 commit 2b425d5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/lxc/lxc.functions.in
Expand Up @@ -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`
8 changes: 4 additions & 4 deletions src/lxc/lxc_config.c
Expand Up @@ -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, },
};

Expand Down
26 changes: 13 additions & 13 deletions src/lxc/utils.c
Expand Up @@ -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 },
};

Expand Down Expand Up @@ -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);
Expand All @@ -358,32 +358,32 @@ static const char *lxc_global_config_value(const char *option_name)

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()
Expand Down

0 comments on commit 2b425d5

Please sign in to comment.