1
0
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:
Osier Yang 2011-08-19 21:52:12 +08:00
parent b3b4aba5d4
commit b9736d5b21

View File

@ -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: