From: Serge Hallyn Date: Tue, 28 May 2013 20:27:42 +0000 (-0500) Subject: api_clone: call is_stopped_locked() to avoid deadlock. X-Git-Tag: lxc-1.0.0.alpha1~1^2~180 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5790f7b7a76b9ccff662fdd6ff0013b8f218d020;p=thirdparty%2Flxc.git api_clone: call is_stopped_locked() to avoid deadlock. 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 --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 2ea9556b3..b34b8e85d 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -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; }