]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
commands: allow waiting for all states
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 21 Nov 2017 19:42:28 +0000 (20:42 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 17 Dec 2017 14:53:47 +0000 (15:53 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/commands.c

index 1fbefbf5763a17d372c78263af3866d8b448e358..a6948b2f25ba8f64d3afb013790d4a97428c8213 100644 (file)
@@ -850,24 +850,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));
@@ -877,7 +859,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;