mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
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;
|
||||
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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user