[PATCH] storage: silently ignore missing files on pool refresh

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

 



From: Wei Zhou <w.zhou@xxxxxxxxxxxx>

Make virStorageBackendVolOpenCheckMode return -2 instead of
-1 if volume file is missing.

https://bugzilla.redhat.com/show_bug.cgi?id=977706
---
 src/storage/storage_backend.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index e2527c9..f063601 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -1084,7 +1084,7 @@ virStorageBackendForType(int type)
  * Allows caller to silently ignore files with improper mode
  *
  * Returns -1 on error, -2 if file mode is unexpected or the
- * volume is a dangling symbolic link.
+ * volume is a dangling symbolic link or file is missing.
  */
 int
 virStorageBackendVolOpenCheckMode(const char *path, unsigned int flags)
@@ -1097,7 +1097,7 @@ virStorageBackendVolOpenCheckMode(const char *path, unsigned int flags)
         virReportSystemError(errno,
                              _("cannot stat file '%s'"),
                              path);
-        return -1;
+        return -2;
     }
 
     if (S_ISFIFO(sb.st_mode)) {
-- 
1.8.1.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]