mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
vmware: Allow to undefine a running domain
This commit is contained in:
parent
b3b4aba5d4
commit
b9736d5b21
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (virDomainObjIsActive(vm)) {
|
||||||
|
vm->persistent = 0;
|
||||||
|
} else {
|
||||||
virDomainRemoveInactive(&driver->domains, vm);
|
virDomainRemoveInactive(&driver->domains, vm);
|
||||||
vm = NULL;
|
vm = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user