From: Serge Hallyn Date: Tue, 14 Apr 2015 19:56:51 +0000 (-0500) Subject: Revert "lxc-cmd-stop: two fixes" X-Git-Tag: lxc-1.1.3~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5dc49b290c12d445baf677c1fd2649da80d6953b;p=thirdparty%2Flxc.git Revert "lxc-cmd-stop: two fixes" This breaks code that depended on the monitor being fully dead before c->stop() returns. This reverts commit 62e041610609c8913c3d397a521716819a91f850. --- diff --git a/src/lxc/commands.c b/src/lxc/commands.c index c2354af43..b70ee7226 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -608,13 +608,11 @@ int lxc_cmd_stop(const char *name, const char *lxcpath) return -1; } - if (!ret) { - WARN("'%s' has stopped before replying with success", name); - return -1; - } - - if (cmd.rsp.ret != 0) { - ERROR("Container %s:%s had an error stopping", lxcpath, name); + /* we do not expect any answer, because we wait for the connection to be + * closed + */ + if (ret > 0) { + ERROR("failed to stop '%s': %s", name, strerror(-cmd.rsp.ret)); return -1; } @@ -639,12 +637,11 @@ static int lxc_cmd_stop_callback(int fd, struct lxc_cmd_req *req, * deadlock us */ if (cgroup_unfreeze(handler)) - goto out; + return 0; ERROR("Failed to unfreeze %s:%s", handler->lxcpath, handler->name); rsp.ret = -1; } -out: return lxc_cmd_rsp_send(fd, &rsp); }