提交 b9736d5b 编写于 作者: O Osier Yang

vmware: Allow to undefine a running domain

上级 b3b4aba5
...@@ -639,20 +639,19 @@ vmwareDomainUndefineFlags(virDomainPtr dom, ...@@ -639,20 +639,19 @@ vmwareDomainUndefineFlags(virDomainPtr dom,
goto cleanup; goto cleanup;
} }
if (virDomainObjIsActive(vm)) {
vmwareError(VIR_ERR_OPERATION_INVALID,
"%s", _("cannot undefine active domain"));
goto cleanup;
}
if (!vm->persistent) { if (!vm->persistent) {
vmwareError(VIR_ERR_OPERATION_INVALID, vmwareError(VIR_ERR_OPERATION_INVALID,
"%s", _("cannot undefine transient domain")); "%s", _("cannot undefine transient domain"));
goto cleanup; goto cleanup;
} }
virDomainRemoveInactive(&driver->domains, vm); if (virDomainObjIsActive(vm)) {
vm = NULL; vm->persistent = 0;
} else {
virDomainRemoveInactive(&driver->domains, vm);
vm = NULL;
}
ret = 0; ret = 0;
cleanup: cleanup:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册