From 5591ca502d7e74392184f19e367a0ab9f00a8646 Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Tue, 16 Feb 2016 10:49:26 +0100 Subject: [PATCH] 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 --- src/conf/domain_conf.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; } -- GitLab