[PATCH 03/13] qemu: Use virErrorPreserveLast in qemuDomainSnapshotCreateDiskActive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_driver.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 8093b27656..65b54b7511 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15301,7 +15301,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,

  error:
     if (ret < 0) {
-        orig_err = virSaveLastError();
+        virErrorPreserveLast(&orig_err);
         for (i = 0; i < snapdef->ndisks; i++) {
             if (!diskdata[i].src)
                 continue;
@@ -15341,11 +15341,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,

  cleanup:
     qemuDomainSnapshotDiskDataFree(diskdata, snapdef->ndisks, driver, vm);
-
-    if (orig_err) {
-        virSetError(orig_err);
-        virFreeError(orig_err);
-    }
+    virErrorRestore(&orig_err);

     return ret;
 }
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux