diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index b2cc0e8ace..ccb17b2f7e 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -276,6 +276,13 @@ libxlVmCleanup(libxlDriverPrivatePtr driver, VIR_DEBUG("Failed to remove domain XML for %s", vm->def->name); VIR_FREE(file); } + + if (vm->newDef) { + virDomainDefFree(vm->def); + vm->def = vm->newDef; + vm->def->id = -1; + vm->newDef = NULL; + } } /*