提交 5591ca50 编写于 作者: J Jiri Denemark

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: NJiri Denemark <jdenemar@redhat.com>
上级 81f50cb9
...@@ -2749,6 +2749,13 @@ virDomainObjWait(virDomainObjPtr vm) ...@@ -2749,6 +2749,13 @@ virDomainObjWait(virDomainObjPtr vm)
_("failed to wait for domain condition")); _("failed to wait for domain condition"));
return -1; return -1;
} }
if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("domain is not running"));
return -1;
}
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册