提交 27a37f16 编写于 作者: F Félix Bouliane 提交者: Michal Privoznik

test driver: error out when domain destroy twice

Fixes the behavior when destroying a domain more than once.
VIR_ERR_OPERATION_INVALID should be raised when destroying an
already destroyed domain.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 214c226f
......@@ -1731,10 +1731,15 @@ static int testDomainDestroy(virDomainPtr domain)
virObjectEventPtr event = NULL;
int ret = -1;
if (!(privdom = testDomObjFromDomain(domain)))
goto cleanup;
if (!virDomainObjIsActive(privdom)) {
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto cleanup;
}
testDomainShutdownState(domain, privdom, VIR_DOMAIN_SHUTOFF_DESTROYED);
event = virDomainEventLifecycleNewFromObj(privdom,
VIR_DOMAIN_EVENT_STOPPED,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册