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: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
214c226f9e
commit
27a37f1670
@ -1731,10 +1731,15 @@ static int testDomainDestroy(virDomainPtr domain)
|
|||||||
virObjectEventPtr event = NULL;
|
virObjectEventPtr event = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
|
|
||||||
if (!(privdom = testDomObjFromDomain(domain)))
|
if (!(privdom = testDomObjFromDomain(domain)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (!virDomainObjIsActive(privdom)) {
|
||||||
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
|
"%s", _("domain is not running"));
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
testDomainShutdownState(domain, privdom, VIR_DOMAIN_SHUTOFF_DESTROYED);
|
testDomainShutdownState(domain, privdom, VIR_DOMAIN_SHUTOFF_DESTROYED);
|
||||||
event = virDomainEventLifecycleNewFromObj(privdom,
|
event = virDomainEventLifecycleNewFromObj(privdom,
|
||||||
VIR_DOMAIN_EVENT_STOPPED,
|
VIR_DOMAIN_EVENT_STOPPED,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user