Commit 0a18b545 by Serge Hallyn

Define LXC_DEFAULT_CONFIG

And use it in place of the various ways we were deducing /etc/lxc/default.conf. Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 3a647d58
......@@ -218,6 +218,7 @@ AS_AC_EXPAND(BINDIR, "$bindir")
AS_AC_EXPAND(LIBEXECDIR, "$libexecdir")
AS_AC_EXPAND(INCLUDEDIR, "$includedir")
AS_AC_EXPAND(SYSCONFDIR, "$sysconfdir")
AS_AC_EXPAND(LXC_DEFAULT_CONFIG, "$sysconfdir/lxc/default.conf")
AS_AC_EXPAND(DATADIR, "$datadir")
AS_AC_EXPAND(LOCALSTATEDIR, "$localstatedir")
AS_AC_EXPAND(DOCDIR, "$docdir")
......
......@@ -94,7 +94,8 @@ AM_CFLAGS=-I$(top_srcdir)/src \
-DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \
-DLXCINITDIR=\"$(LXCINITDIR)\" \
-DLXCTEMPLATEDIR=\"$(LXCTEMPLATEDIR)\" \
-DLOGPATH=\"$(LOGPATH)\"
-DLOGPATH=\"$(LOGPATH)\" \
-DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\"
if ENABLE_APPARMOR
AM_CFLAGS += -DHAVE_APPARMOR
......
......@@ -135,8 +135,6 @@ bool validate_bdev_args(struct lxc_arguments *a)
return true;
}
/* grab this through autoconf from @config-path@ ? */
#define DEFAULT_CONFIG "/etc/lxc/default.conf"
int main(int argc, char *argv[])
{
struct lxc_container *c;
......@@ -174,7 +172,7 @@ int main(int argc, char *argv[])
if (my_args.configfile)
c->load_config(c, my_args.configfile);
else
c->load_config(c, DEFAULT_CONFIG);
c->load_config(c, LXC_DEFAULT_CONFIG);
if (strcmp(my_args.bdevtype, "zfs") == 0) {
if (my_args.zfsroot)
......
......@@ -1158,9 +1158,6 @@ static int lxcapi_get_keys(struct lxc_container *c, const char *key, char *retv,
return ret;
}
/* default config file - should probably come through autoconf */
#define LXC_DEFAULT_CONFIG "/etc/lxc/default.conf"
static bool lxcapi_save_config(struct lxc_container *c, const char *alt_file)
{
FILE *fout;
......
......@@ -20,7 +20,8 @@ AM_CFLAGS=-I$(top_srcdir)/src \
-DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \
-DLXCPATH=\"$(LXCPATH)\" \
-DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \
-DLXCINITDIR=\"$(LXCINITDIR)\"
-DLXCINITDIR=\"$(LXCINITDIR)\" \
-DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\"
bin_PROGRAMS = lxc-test-containertests lxc-test-locktests lxc-test-startone \
lxc-test-destroytest lxc-test-saveconfig lxc-test-createtest \
......
......@@ -71,7 +71,7 @@ static int create_busybox(void)
return -1;
}
if (pid == 0) {
ret = execlp("lxc-create", "lxc-create", "-t", "busybox", "-f", "/etc/lxc/default.conf", "-n", MYNAME, NULL);
ret = execlp("lxc-create", "lxc-create", "-t", "busybox", "-f", LXC_DEFAULT_CONFIG, "-n", MYNAME, NULL);
// Should not return
perror("execl");
exit(1);
......
......@@ -38,7 +38,7 @@ static int create_ubuntu(void)
return -1;
}
if (pid == 0) {
ret = execlp("lxc-create", "lxc-create", "-t", "ubuntu", "-f", "/etc/lxc/default.conf", "-n", MYNAME, NULL);
ret = execlp("lxc-create", "lxc-create", "-t", "ubuntu", "-f", LXC_DEFAULT_CONFIG, "-n", MYNAME, NULL);
// Should not return
perror("execl");
exit(1);
......
......@@ -38,7 +38,7 @@ static int create_ubuntu(void)
return -1;
}
if (pid == 0) {
ret = execlp("lxc-create", "lxc-create", "-t", "ubuntu", "-f", "/etc/lxc/default.conf", "-n", MYNAME, NULL);
ret = execlp("lxc-create", "lxc-create", "-t", "ubuntu", "-f", LXC_DEFAULT_CONFIG, "-n", MYNAME, NULL);
// Should not return
perror("execl");
exit(1);
......
......@@ -70,7 +70,7 @@ static int create_ubuntu(void)
return -1;
}
if (pid == 0) {
ret = execlp("lxc-create", "lxc-create", "-t", "ubuntu", "-f", "/etc/lxc/default.conf", "-n", MYNAME, NULL);
ret = execlp("lxc-create", "lxc-create", "-t", "ubuntu", "-f", LXC_DEFAULT_CONFIG, "-n", MYNAME, NULL);
// Should not return
perror("execl");
exit(1);
......
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