]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
api_clone: call is_stopped_locked() to avoid deadlock.
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 28 May 2013 20:27:42 +0000 (15:27 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 28 May 2013 20:27:42 +0000 (15:27 -0500)
Technically as Dwight has mentioned we should probably drop the locking
from api_state() altogether, since those are protected through the
lxc command system.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.c

index 2ea9556b346978cf00a77c64691d42e3eb88f485..b34b8e85da8679decfd898ba14b095d0ec8f3e6f 100644 (file)
@@ -1827,7 +1827,7 @@ struct lxc_container *lxcapi_clone(struct lxc_container *c, const char *newname,
        if (container_mem_lock(c))
                return NULL;
 
-       if (c->is_running(c)) {
+       if (!is_stopped_locked(c)) {
                ERROR("error: Original container (%s) is running", c->name);
                goto out;
        }