[Patch]Sheepdog storage driver ignore refreshVol func's return value

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

 



Hi all,

In libvirt/src/storage/storage_backend_sheepdog.c file, func
virStorageBackendSheepdogCreateVol calls func
virStorageBackendSheepdogRefreshVol to refresh Sheepdog volume infos.
But we do not check func virStorageBackendSheepdogRefreshVol's return
value. Following patch can fix this bug.

Signed-off-by: Harry Wei <harryxiyou@xxxxxxxxx>
Subject: [PATCH] sheepdog driver ignore return value for refresh volume

---
 src/storage/storage_backend_sheepdog.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/storage/storage_backend_sheepdog.c
b/src/storage/storage_backend_sheepdog.c
index 66d8fb4..e72c944 100644
--- a/src/storage/storage_backend_sheepdog.c
+++ b/src/storage/storage_backend_sheepdog.c
@@ -168,9 +168,12 @@ virStorageBackendSheepdogCreateVol(virConnectPtr
conn ATTRIBUTE_UNUSED,
     virCommandAddArgFormat(cmd, "%llu", vol->capacity);
     virStorageBackendSheepdogAddHostArg(cmd, pool);
     ret = virCommandRun(cmd, NULL);
+	if (0 > ret)
+		goto cleanup;

-    virStorageBackendSheepdogRefreshVol(conn, pool, vol);
+    ret = virStorageBackendSheepdogRefreshVol(conn, pool, vol);

+cleanup:
     virCommandFree(cmd);
     return ret;
 }
-- 
1.7.0.4


-- 
Thanks
Harry Wei

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