mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
bhyve: start using virDomainObjCheckActive
Signed-off-by: Clementine Hayat <clem@lse.epita.fr> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
3c311d7e9b
commit
920a7d3336
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user