[lxc-devel] [lxc/master] start: __lxc_start return -1 when start fails

lifeng68 on Github lxc-bot at linuxcontainers.org
Wed Jan 16 08:49:16 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 344 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190116/80580d75/attachment.bin>
-------------- next part --------------
From 575ea46728b10bdb1724b05b517beceb13eff567 Mon Sep 17 00:00:00 2001
From: LiFeng <lifeng68 at huawei.com>
Date: Tue, 15 Jan 2019 07:25:00 -0500
Subject: [PATCH] start: __lxc_start return -1 when start fails

Signed-off-by: LiFeng <lifeng68 at huawei.com>
---
 src/lxc/start.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/lxc/start.c b/src/lxc/start.c
index 49c2018ca..91f1e51b7 100644
--- a/src/lxc/start.c
+++ b/src/lxc/start.c
@@ -1940,16 +1940,19 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
 
 	if (!attach_block_device(handler->conf)) {
 		ERROR("Failed to attach block device");
+		ret = -1;
 		goto out_fini_nonet;
 	}
 
 	if (!cgroup_ops->monitor_create(cgroup_ops, handler)) {
 		ERROR("Failed to create monitor cgroup");
+		ret = -1;
 		goto out_fini_nonet;
 	}
 
 	if (!cgroup_ops->monitor_enter(cgroup_ops, handler->monitor_pid)) {
 		ERROR("Failed to enter monitor cgroup");
+		ret = -1;
 		goto out_fini_nonet;
 	}
 
@@ -1994,6 +1997,7 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
 
 	if (!handler->init_died && handler->pid > 0) {
 		ERROR("Child process is not killed");
+		ret = -1;
 		goto out_abort;
 	}
 


More information about the lxc-devel mailing list