From: Daniel Lezcano Date: Mon, 30 Mar 2009 12:02:19 +0000 (+0200) Subject: move lxc_conf_init to conf.c X-Git-Tag: lxc_0_6_2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=089cd8b878d1d2ac78a6ab13878c61cb23213971;p=thirdparty%2Flxc.git move lxc_conf_init to conf.c Changed the struct lxc_conf initialization function to the right place. Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 96e4ed813..6c3476af0 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1300,6 +1300,18 @@ out: return ret; } +int lxc_conf_init(struct lxc_conf *conf) +{ + conf->rootfs = NULL; + conf->fstab = NULL; + conf->utsname = NULL; + conf->tty = 0; + conf->pts = 0; + lxc_list_init(&conf->cgroup); + lxc_list_init(&conf->networks); + return 0; +} + int lxc_configure(const char *name, struct lxc_conf *conf) { if (!conf) diff --git a/src/lxc/conf.h b/src/lxc/conf.h index 204a2840a..1f555880a 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -150,6 +150,11 @@ struct lxc_tty_info { struct lxc_pty_info *pty_info; }; +/* + * Initialize the lxc configuration structure + */ +extern int lxc_conf_init(struct lxc_conf *conf); + /* * Configure the external resources for the container */ diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 4a2fc5cf2..725a95933 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -564,15 +564,3 @@ int lxc_config_read(const char *file, struct lxc_conf *conf) return lxc_file_for_each_line(file, parse_line, buffer, sizeof(buffer), conf); } - -int lxc_config_init(struct lxc_conf *conf) -{ - conf->rootfs = NULL; - conf->fstab = NULL; - conf->utsname = NULL; - conf->tty = 0; - conf->pts = 0; - lxc_list_init(&conf->cgroup); - lxc_list_init(&conf->networks); - return 0; -} diff --git a/src/lxc/confile.h b/src/lxc/confile.h index f81217be0..d0e7653e8 100644 --- a/src/lxc/confile.h +++ b/src/lxc/confile.h @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -extern int lxc_config_init(struct lxc_conf *conf); extern int lxc_config_read(const char *file, struct lxc_conf *conf); diff --git a/src/lxc/lxc_create.c b/src/lxc/lxc_create.c index 12e14f9e2..00dbb83fc 100644 --- a/src/lxc/lxc_create.c +++ b/src/lxc/lxc_create.c @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) if (!name) usage(argv[0]); - if (lxc_config_init(&lxc_conf)) { + if (lxc_conf_init(&lxc_conf)) { fprintf(stderr, "failed to initialize the configuration\n"); return 1; } diff --git a/src/lxc/lxc_execute.c b/src/lxc/lxc_execute.c index bdf65aa13..7cda46806 100644 --- a/src/lxc/lxc_execute.c +++ b/src/lxc/lxc_execute.c @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) argc -= nbargs; - if (lxc_config_init(&lxc_conf)) { + if (lxc_conf_init(&lxc_conf)) { fprintf(stderr, "failed to initialize the configuration\n"); goto out; }