[libvirt] [PATCH] Fix error squashing when refreshing file volumes

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

 



When refreshing a file based pool, errors hit when determining a
volume's format were being squashed, reporting OOM instead. The attached
patch fixes the error reporting here.

Reported by Jason Guiditta.

Thanks,
Cole
diff --git a/src/storage_backend.c b/src/storage_backend.c
index b154140..acdb288 100644
--- a/src/storage_backend.c
+++ b/src/storage_backend.c
@@ -156,6 +156,10 @@ virStorageBackendUpdateVolInfo(virConnectPtr conn,
     return 0;
 }
 
+/*
+ * Return -1 on a legitimate error condition
+ * Return -2 if passed FD isn't a regular, char, or block file.
+ */
 int
 virStorageBackendUpdateVolTargetInfoFD(virConnectPtr conn,
                                        virStorageVolTargetPtr target,
diff --git a/src/storage_backend_fs.c b/src/storage_backend_fs.c
index 92ff3cb..d64b64d 100644
--- a/src/storage_backend_fs.c
+++ b/src/storage_backend_fs.c
@@ -843,7 +843,7 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn,
                                                 &vol->allocation,
                                                 &vol->capacity) < 0)) {
             if (ret == -1)
-                goto no_memory;
+                goto cleanup;
             else {
                 /* Silently ignore non-regular files,
                  * eg '.' '..', 'lost+found' */
@@ -883,7 +883,7 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn,
                                                         &vol->backingStore,
                                                         NULL, NULL, NULL)) < 0) {
                     if (ret == -1)
-                        goto no_memory;
+                        goto cleanup;
                     else {
                         /* Silently ignore non-regular files,
                          * eg '.' '..', 'lost+found' */
--
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]