]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix libxl vm def handling on domU cleanup
authorMarkus Groß <gross@univention.de>
Thu, 26 May 2011 15:16:31 +0000 (23:16 +0800)
committerDaniel Veillard <veillard@redhat.com>
Thu, 26 May 2011 15:16:31 +0000 (23:16 +0800)
* src/libxl/libxl_driver.c: in libxlVmCleanup, free up the
  newDef definition if present overwise it would be leaked.

src/libxl/libxl_driver.c

index b2cc0e8ace2a0e310394f8f9c9dd73b7717fffa5..ccb17b2f7ee7c6430c3e522cf5f8bcd40c019828 100644 (file)
@@ -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;
+    }
 }
 
 /*