From: Jiri Denemark Date: Tue, 16 Feb 2016 09:49:26 +0000 (+0100) Subject: Check for active domain in virDomainObjWait X-Git-Tag: v1.3.2-rc1~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5591ca502d7e74392184f19e367a0ab9f00a8646;p=thirdparty%2Flibvirt.git Check for active domain in virDomainObjWait virDomainObjWait is designed to be called in a loop. Make sure we break the loop in case the domain dies to avoid waiting for an event which will never happen. Signed-off-by: Jiri Denemark --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index acd58a1b61..ba67433c5c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2749,6 +2749,13 @@ virDomainObjWait(virDomainObjPtr vm) _("failed to wait for domain condition")); return -1; } + + if (!virDomainObjIsActive(vm)) { + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("domain is not running")); + return -1; + } + return 0; }