[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[libvirt] [PATCH] Fix error squashing when refreshing file volumes
- From: Cole Robinson <crobinso redhat com>
- To: Libvirt <libvir-list redhat com>
- Subject: [libvirt] [PATCH] Fix error squashing when refreshing file volumes
- Date: Mon, 11 May 2009 10:03:24 -0400
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' */
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]