[PATCH 1/3] rbd: Change virStorageBackendRBDCloseRADOSConn to be static void

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

 



Since none of the callers check the status, let's just alter it from
a (global!) int to be a static void.

While we're at it - scrap the local runtime variable and just do the
math in the VIR_DEBUG directly.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/storage/storage_backend_rbd.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index 21693c4..4e82232 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -205,29 +205,23 @@ virStorageBackendRBDOpenIoCTX(virStorageBackendRBDStatePtr ptr,
     return r;
 }
 
-static int
+static void
 virStorageBackendRBDCloseRADOSConn(virStorageBackendRBDStatePtr ptr)
 {
-    int ret = 0;
-
     if (ptr->ioctx != NULL) {
         VIR_DEBUG("Closing RADOS IoCTX");
         rados_ioctx_destroy(ptr->ioctx);
-        ret = -1;
     }
     ptr->ioctx = NULL;
 
     if (ptr->cluster != NULL) {
         VIR_DEBUG("Closing RADOS connection");
         rados_shutdown(ptr->cluster);
-        ret = -2;
     }
     ptr->cluster = NULL;
 
-    time_t runtime = time(0) - ptr->starttime;
-    VIR_DEBUG("RADOS connection existed for %ld seconds", runtime);
-
-    return ret;
+    VIR_DEBUG("RADOS connection existed for %ld seconds",
+              time(0) - ptr->starttime);
 }
 
 static int
-- 
2.7.4

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