[PATCH] qemu_ga: Don't overwrite errors on FSThaw

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

 



We can tell qemuDomainSnapshotFSThaw if we want it to report errors or
not. However, if we don't want to and an error has been already set by
previous qemuReportError() we must keep copy of that error not just a
pointer to it. Otherwise, it get overwritten if FSThaw reports an error.
---
 src/qemu/qemu_driver.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index dd79973..0880f51 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -9636,16 +9636,13 @@ qemuDomainSnapshotFSThaw(struct qemud_driver *driver,
 
     qemuDomainObjEnterAgent(driver, vm);
     if (!report)
-        err = virGetLastError();
+        err = virSaveLastError();
     thawed = qemuAgentFSThaw(priv->agent);
-    if (!report) {
-        if (err)
-            virResetError(err);
-        else
-            virResetLastError();
-    }
+    if (!report)
+        virSetError(err);
     qemuDomainObjExitAgent(driver, vm);
 
+    virFreeError(err);
     return thawed;
 }
 
-- 
1.7.8.5

--
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]