[libvirt] [PATCH] storage_driver.c: remove two useless calls to virStorageBackendForType

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

 



>From dead-store warnings:

>From c925b02828083a016f7b9a7ae93eb3a7bf5f4609 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@xxxxxxxxxx>
Date: Fri, 4 Sep 2009 17:18:29 +0200
Subject: [PATCH] storage_driver.c: remove two useless calls to virStorageBackendForType

* src/storage_driver.c (storagePoolGetInfo, storagePoolDefine):
The result was never used, and the function has no side effects.
---
 src/storage_driver.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/src/storage_driver.c b/src/storage_driver.c
index e9ecb20..e8d43b7 100644
--- a/src/storage_driver.c
+++ b/src/storage_driver.c
@@ -519,15 +519,11 @@ storagePoolDefine(virConnectPtr conn,
     virStoragePoolDefPtr def;
     virStoragePoolObjPtr pool = NULL;
     virStoragePoolPtr ret = NULL;
-    virStorageBackendPtr backend;

     storageDriverLock(driver);
     if (!(def = virStoragePoolDefParseString(conn, xml)))
         goto cleanup;

-    if ((backend = virStorageBackendForType(def->type)) == NULL)
-        goto cleanup;
-
     if (!(pool = virStoragePoolObjAssignDef(conn, &driver->pools, def)))
         goto cleanup;

@@ -847,7 +843,6 @@ storagePoolGetInfo(virStoragePoolPtr obj,
                    virStoragePoolInfoPtr info) {
     virStorageDriverStatePtr driver = obj->conn->storagePrivateData;
     virStoragePoolObjPtr pool;
-    virStorageBackendPtr backend;
     int ret = -1;

     storageDriverLock(driver);
@@ -860,9 +855,6 @@ storagePoolGetInfo(virStoragePoolPtr obj,
         goto cleanup;
     }

-    if ((backend = virStorageBackendForType(pool->def->type)) == NULL)
-        goto cleanup;
-
     memset(info, 0, sizeof(virStoragePoolInfo));
     if (pool->active)
         info->state = VIR_STORAGE_POOL_RUNNING;
--
1.6.4.2.409.g85dc3

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