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 <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2016-02-16 10:49:26 +01:00
parent 81f50cb92d
commit 5591ca502d

View File

@ -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;
}