Store the container in the handler, so it is accessible
everywhere.

Signed-off-by: Daniel Lezcano <dlezcan@fr.ibm.com>
---
 src/lxc/start.c |   12 +++++++++++-
 src/lxc/start.h |    1 +
 2 files changed, 12 insertions(+), 1 deletion(-)

Index: lxc/src/lxc/start.c
===================================================================
--- lxc.orig/src/lxc/start.c
+++ lxc/src/lxc/start.c
@@ -196,10 +196,16 @@ struct lxc_handler *lxc_init(const char
 
 	handler->conf = conf;
 
+	handler->name = strdup(name);
+	if (!handler->name) {
+		ERROR("failed to allocate memory");
+		goto out_free;
+	}
+
 	/* Begin the set the state to STARTING*/
 	if (lxc_set_state(name, handler, STARTING)) {
 		ERROR("failed to set state '%s'", lxc_state2str(STARTING));
-		goto out_free;
+		goto out_free_name;
 	}
 
 	if (lxc_create_tty(name, conf)) {
@@ -234,6 +240,9 @@ out_delete_tty:
 	lxc_delete_tty(&conf->tty_info);
 out_aborting:
 	lxc_set_state(name, handler, ABORTING);
+out_free_name:
+	free(handler->name);
+	handler->name = NULL;
 out_free:
 	free(handler);
 	return NULL;
@@ -249,6 +258,7 @@ void lxc_fini(const char *name, struct l
 	lxc_unlink_nsgroup(name);
 
 	lxc_delete_tty(&handler->conf->tty_info);
+	free(handler->name);
 	free(handler);
 
 	LXC_TTY_DEL_HANDLER(SIGQUIT);
Index: lxc/src/lxc/start.h
===================================================================
--- lxc.orig/src/lxc/start.h
+++ lxc/src/lxc/start.h
@@ -30,6 +30,7 @@ struct lxc_conf;
 
 struct lxc_handler {
 	pid_t pid;
+	char *name;
 	lxc_state_t state;
 	int sigfd;
 	char nsgroup[MAXPATHLEN];



