mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03: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;
|
||||
}
|
||||
|
||||
if (virDomainObjIsActive(vm)) {
|
||||
vmwareError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("cannot undefine active domain"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!vm->persistent) {
|
||||
vmwareError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("cannot undefine transient domain"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
virDomainRemoveInactive(&driver->domains, vm);
|
||||
vm = NULL;
|
||||
if (virDomainObjIsActive(vm)) {
|
||||
vm->persistent = 0;
|
||||
} else {
|
||||
virDomainRemoveInactive(&driver->domains, vm);
|
||||
vm = NULL;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
|
Loading…
Reference in New Issue
Block a user