[PATCH 5/5] storage: Save error during refresh failure processing

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

 



https://bugzilla.redhat.com/show_bug.cgi?id=1614283

Save the error from the refresh failure because the stopPool
processing may overwrite the error or even worse clear it
due to calling an external libvirt API that resets the last
error such as is the case with the SCSI pool which may call
virGetConnectNodeDev (see commit decaeb288) in order to
process deleting an NPIV vport.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/storage/storage_driver.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 8aa3191f7b..f032d0dfdd 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -84,10 +84,16 @@ storagePoolRefreshFailCleanup(virStorageBackendPtr backend,
                               virStoragePoolObjPtr obj,
                               const char *stateFile)
 {
+    virErrorPtr orig_err = virSaveLastError();
+
     if (stateFile)
         ignore_value(unlink(stateFile));
     if (backend->stopPool)
         backend->stopPool(obj);
+    if (orig_err) {
+        virSetError(orig_err);
+        virFreeError(orig_err);
+    }
 }
 
 
-- 
2.17.1

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