提交 08bd268c 编写于 作者: R Roman Bogorodskiy

bhyve: allow to destroy only active domains

Add a check that domain is active before attempting to destroy it.
上级 ef2c4c96
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册