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
1 changed files with 7 additions and 8 deletions

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: