[libvirt] [PATCH 1/2] qemu: snapshot: Don't leak XML definition if restarting of CPUs fails

Peter Krempa pkrempa at redhat.com
Tue Dec 11 11:10:51 UTC 2012


In case the snapshot code isn't able to restart CPUs after an external
checkpoint we would leak a copy of the domains XML definition. This
patch fixes the cleanup path.
---
 src/qemu/qemu_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 8fb0000..0a801f3 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -11490,7 +11490,8 @@ endjob:
                            _("resuming after snapshot failed"));
         }

-        return -1;
+        ret = -1;
+        goto cleanup;
     }
     if (vm && thaw != 0 &&
         qemuDomainSnapshotFSThaw(driver, vm, thaw > 0) < 0) {
-- 
1.8.0




More information about the libvir-list mailing list