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

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



From: Wei Zhou <w zhou leaseweb com>

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


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