]> xenbits.xensource.com Git - libvirt.git/commitdiff
rbd: Change virStorageBackendRBDCloseRADOSConn to be static void
authorJohn Ferlan <jferlan@redhat.com>
Wed, 14 Sep 2016 18:01:34 +0000 (14:01 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 5 Oct 2016 15:07:52 +0000 (11:07 -0400)
Since none of the callers check the status, let's just alter it to
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@redhat.com>
src/storage/storage_backend_rbd.c

index 21693c416c79a0e8434e703172a169448a26fd18..4e8223275461bc93561181afa0df72f28bccdf4c 100644 (file)
@@ -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