mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05: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:
1 parent
ef2c4c965b
commit
08bd268c0d
1 file changed
+6
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user