提交 920a7d33 编写于 作者: C Clementine Hayat 提交者: Ján Tomko

bhyve: start using virDomainObjCheckActive

Signed-off-by: NClementine Hayat <clem@lse.epita.fr>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
Signed-off-by: NJán Tomko <jtomko@redhat.com>
上级 3c311d7e
......@@ -989,11 +989,8 @@ 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"));
if (virDomainObjCheckActive(vm) < 0)
goto cleanup;
}
ret = virBhyveProcessStop(privconn, vm, VIR_DOMAIN_SHUTOFF_DESTROYED);
event = virDomainEventLifecycleNewFromObj(vm,
......@@ -1022,11 +1019,8 @@ bhyveDomainShutdown(virDomainPtr dom)
if (virDomainShutdownEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("Domain is not running"));
if (virDomainObjCheckActive(vm) < 0)
goto cleanup;
}
ret = virBhyveProcessShutdown(vm);
......@@ -1053,11 +1047,8 @@ bhyveDomainOpenConsole(virDomainPtr dom,
if (virDomainOpenConsoleEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
if (virDomainObjCheckActive(vm) < 0)
goto cleanup;
}
if (!vm->def->nserials) {
virReportError(VIR_ERR_INTERNAL_ERROR,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册