[lxc-devel] [PATCH 4/4] Drop usage of LXC_DEFAULT_CONFIG in our code

Stéphane Graber stgraber at ubuntu.com
Thu Jan 9 23:33:07 UTC 2014


Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 src/lxc/lxc_create.c       | 2 +-
 src/lxc/lxccontainer.c     | 8 ++++----
 src/tests/containertests.c | 2 +-
 src/tests/destroytest.c    | 2 +-
 src/tests/saveconfig.c     | 2 +-
 src/tests/startone.c       | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/lxc/lxc_create.c b/src/lxc/lxc_create.c
index 42eb8d9..d02dacc 100644
--- a/src/lxc/lxc_create.c
+++ b/src/lxc/lxc_create.c
@@ -229,7 +229,7 @@ int main(int argc, char *argv[])
 	if (my_args.configfile)
 		c->load_config(c, my_args.configfile);
 	else
-		c->load_config(c, LXC_DEFAULT_CONFIG);
+		c->load_config(c, lxc_global_config_value("lxc.default_config"));
 
 	if (my_args.fstype)
 		spec.fstype = my_args.fstype;
diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
index faa0a9f..48fef74 100644
--- a/src/lxc/lxccontainer.c
+++ b/src/lxc/lxccontainer.c
@@ -1186,8 +1186,8 @@ static bool lxcapi_create(struct lxc_container *c, const char *t,
 	}
 
 	if (!c->lxc_conf) {
-		if (!c->load_config(c, LXC_DEFAULT_CONFIG)) {
-			ERROR("Error loading default configuration file %s\n", LXC_DEFAULT_CONFIG);
+		if (!c->load_config(c, lxc_global_config_value("lxc.default_config"))) {
+			ERROR("Error loading default configuration file %s\n", lxc_global_config_value("lxc.default_config"));
 			goto free_tpath;
 		}
 	}
@@ -1658,8 +1658,8 @@ static bool lxcapi_save_config(struct lxc_container *c, const char *alt_file)
 
 	// If we haven't yet loaded a config, load the stock config
 	if (!c->lxc_conf) {
-		if (!c->load_config(c, LXC_DEFAULT_CONFIG)) {
-			ERROR("Error loading default configuration file %s while saving %s\n", LXC_DEFAULT_CONFIG, c->name);
+		if (!c->load_config(c, lxc_global_config_value("lxc.default_config"))) {
+			ERROR("Error loading default configuration file %s while saving %s\n", lxc_global_config_value("lxc.default_config"), c->name);
 			return false;
 		}
 	}
diff --git a/src/tests/containertests.c b/src/tests/containertests.c
index d3742e7..aaf29e5 100644
--- a/src/tests/containertests.c
+++ b/src/tests/containertests.c
@@ -72,7 +72,7 @@ static int create_busybox(void)
 		return -1;
 	}
 	if (pid == 0) {
-		ret = execlp("lxc-create", "lxc-create", "-t", "busybox", "-f", LXC_DEFAULT_CONFIG, "-n", MYNAME, NULL);
+		ret = execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL);
 		// Should not return
 		perror("execl");
 		exit(1);
diff --git a/src/tests/destroytest.c b/src/tests/destroytest.c
index 6403472..4d05119 100644
--- a/src/tests/destroytest.c
+++ b/src/tests/destroytest.c
@@ -38,7 +38,7 @@ static int create_ubuntu(void)
 		return -1;
 	}
 	if (pid == 0) {
-		ret = execlp("lxc-create", "lxc-create", "-t", "ubuntu", "-f", LXC_DEFAULT_CONFIG, "-n", MYNAME, NULL);
+		ret = execlp("lxc-create", "lxc-create", "-t", "ubuntu", "-n", MYNAME, NULL);
 		// Should not return
 		perror("execl");
 		exit(1);
diff --git a/src/tests/saveconfig.c b/src/tests/saveconfig.c
index a6eae65..a455294 100644
--- a/src/tests/saveconfig.c
+++ b/src/tests/saveconfig.c
@@ -38,7 +38,7 @@ static int create_ubuntu(void)
 		return -1;
 	}
 	if (pid == 0) {
-		ret = execlp("lxc-create", "lxc-create", "-t", "ubuntu", "-f", LXC_DEFAULT_CONFIG, "-n", MYNAME, NULL);
+		ret = execlp("lxc-create", "lxc-create", "-t", "ubuntu", "-n", MYNAME, NULL);
 		// Should not return
 		perror("execl");
 		exit(1);
diff --git a/src/tests/startone.c b/src/tests/startone.c
index 08587ea..678f62e 100644
--- a/src/tests/startone.c
+++ b/src/tests/startone.c
@@ -71,7 +71,7 @@ static int create_ubuntu(void)
 		return -1;
 	}
 	if (pid == 0) {
-		ret = execlp("lxc-create", "lxc-create", "-t", "ubuntu", "-f", LXC_DEFAULT_CONFIG, "-n", MYNAME, NULL);
+		ret = execlp("lxc-create", "lxc-create", "-t", "ubuntu", "-n", MYNAME, NULL);
 		// Should not return
 		perror("execl");
 		exit(1);
-- 
1.8.5.2



More information about the lxc-devel mailing list