mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
bhyve: allow to destroy only active domains
Add a check that domain is active before attempting to destroy it.
This commit is contained in:
parent
ef2c4c965b
commit
08bd268c0d
@ -567,6 +567,12 @@ bhyveDomainDestroy(virDomainPtr dom)
|
||||
if (virDomainDestroyEnsureACL(dom->conn, vm->def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("Domain is not running"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = virBhyveProcessStop(privconn, vm, VIR_DOMAIN_SHUTOFF_DESTROYED);
|
||||
|
||||
cleanup:
|
||||
|
Loading…
x
Reference in New Issue
Block a user