From: Christian Brauner Date: Tue, 21 Nov 2017 19:42:28 +0000 (+0100) Subject: commands: allow waiting for all states X-Git-Tag: lxc-3.0.0.beta1~130^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=24b0bd9a80a1a83b292afa61b1970730d01d4963;p=thirdparty%2Flxc.git commands: allow waiting for all states Signed-off-by: Christian Brauner --- diff --git a/src/lxc/commands.c b/src/lxc/commands.c index 8998dc373..4056fb7ac 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -914,24 +914,6 @@ int lxc_cmd_add_state_client(const char *name, const char *lxcpath, return state; } - if ((state == STARTING) && !states[RUNNING] && !states[STOPPING] && !states[STOPPED]) { - TRACE("Container is in %s state and caller requested to be " - "informed about a previous state", lxc_state2str(state)); - return state; - } else if ((state == RUNNING) && !states[STOPPING] && !states[STOPPED]) { - TRACE("Container is in %s state and caller requested to be " - "informed about a previous state", lxc_state2str(state)); - return state; - } else if ((state == STOPPING) && !states[STOPPED]) { - TRACE("Container is in %s state and caller requested to be " - "informed about a previous state", lxc_state2str(state)); - return state; - } else if ((state == STOPPED) || (state == ABORTING)) { - TRACE("Container is in %s state and caller requested to be " - "informed about a previous state", lxc_state2str(state)); - return state; - } - ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) { ERROR("%s - Failed to execute command", strerror(errno)); @@ -941,7 +923,6 @@ int lxc_cmd_add_state_client(const char *name, const char *lxcpath, /* We should now be guaranteed to get an answer from the state sending * function. */ - if (cmd.rsp.ret < 0) { ERROR("Failed to receive socket fd"); return -1;