From 685753a3605f0c4d7e5aab8c73bac71fcddde963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gro=C3=9F?= Date: Thu, 26 May 2011 23:16:31 +0800 Subject: [PATCH] Fix libxl vm def handling on domU cleanup * src/libxl/libxl_driver.c: in libxlVmCleanup, free up the newDef definition if present overwise it would be leaked. --- src/libxl/libxl_driver.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; + } } /*