Commit b45a7402 by Dwight Engen Committed by Stéphane Graber

Use autoconf LXCPATH instead of hardcoded LXCDIR

LXCDIR is only used in lxc_container_new, whereas LXCPATH is used throughout the rest of lxc, and even in the same file as lxc_container_new (for example create_container_dir()). Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 7ec3fa71
......@@ -882,13 +882,13 @@ struct lxc_container *lxc_container_new(char *name)
goto err;
}
len = strlen(LXCDIR)+strlen(c->name)+strlen("/config")+2;
len = strlen(LXCPATH)+strlen(c->name)+strlen("/config")+2;
c->configfile = malloc(len);
if (!c->configfile) {
fprintf(stderr, "Error allocating config file pathname\n");
goto err;
}
ret = snprintf(c->configfile, len, "%s/%s/config", LXCDIR, c->name);
ret = snprintf(c->configfile, len, "%s/%s/config", LXCPATH, c->name);
if (ret < 0 || ret >= len) {
fprintf(stderr, "Error printing out config file name\n");
goto err;
......@@ -928,7 +928,7 @@ struct lxc_container *lxc_container_new(char *name)
}
/*
* default configuration file is $LXCDIR/$NAME/config
* default configuration file is $LXCPATH/$NAME/config
*/
return c;
......
......@@ -18,7 +18,6 @@ struct lxc_container {
int error_num;
int daemonize;
#define LXCDIR "/var/lib/lxc"
bool (*is_defined)(struct lxc_container *c); // did /var/lib/lxc/$name/config exist
const char *(*state)(struct lxc_container *c);
bool (*is_running)(struct lxc_container *c); // true so long as defined and not stopped
......
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