diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index 5c63239c456519b3f7f873a8f01e42f930952b1b..b2cfdcefac03dd9c8e1d3eb638c1b0702739c4a5 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -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: