[PATCH 7/9] virDomainDiskTranslateISCSIDirect: Take virStorageSourcePtr instead of virDomainDiskDefPtr

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

 



Only 'def->src' was ever used in this function. Use the source directly.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4545c6b314..531c765032 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -31392,30 +31392,30 @@ virDomainDiskTranslateSourcePoolAuth(virStorageSourcePtr src,


 static int
-virDomainDiskTranslateISCSIDirect(virDomainDiskDefPtr def,
+virDomainDiskTranslateISCSIDirect(virStorageSourcePtr src,
                                   virStoragePoolDefPtr pooldef)
 {
-    def->src->srcpool->actualtype = VIR_STORAGE_TYPE_NETWORK;
-    def->src->protocol = VIR_STORAGE_NET_PROTOCOL_ISCSI;
+    src->srcpool->actualtype = VIR_STORAGE_TYPE_NETWORK;
+    src->protocol = VIR_STORAGE_NET_PROTOCOL_ISCSI;

-    if (virDomainDiskTranslateSourcePoolAuth(def->src,
+    if (virDomainDiskTranslateSourcePoolAuth(src,
                                              &pooldef->source) < 0)
         return -1;

     /* Source pool may not fill in the secrettype field,
      * so we need to do so here
      */
-    if (def->src->auth && !def->src->auth->secrettype) {
+    if (src->auth && !src->auth->secrettype) {
         const char *secrettype =
             virSecretUsageTypeToString(VIR_SECRET_USAGE_TYPE_ISCSI);
-        def->src->auth->secrettype = g_strdup(secrettype);
+        src->auth->secrettype = g_strdup(secrettype);
     }

-    if (virDomainDiskAddISCSIPoolSourceHost(def->src, pooldef) < 0)
+    if (virDomainDiskAddISCSIPoolSourceHost(src, pooldef) < 0)
         return -1;

-    if (!def->src->initiator.iqn && pooldef->source.initiator.iqn &&
-        virStorageSourceInitiatorCopy(&def->src->initiator,
+    if (!src->initiator.iqn && pooldef->source.initiator.iqn &&
+        virStorageSourceInitiatorCopy(&src->initiator,
                                       &pooldef->source.initiator) < 0) {
         return -1;
     }
@@ -31540,7 +31540,7 @@ virDomainDiskTranslateSourcePool(virDomainDiskDefPtr def)
             return -1;
         }

-        if (virDomainDiskTranslateISCSIDirect(def, pooldef) < 0)
+        if (virDomainDiskTranslateISCSIDirect(def->src, pooldef) < 0)
             return -1;

         break;
@@ -31565,7 +31565,7 @@ virDomainDiskTranslateSourcePool(virDomainDiskDefPtr def)
            break;

        case VIR_STORAGE_SOURCE_POOL_MODE_DIRECT:
-           if (virDomainDiskTranslateISCSIDirect(def, pooldef) < 0)
+           if (virDomainDiskTranslateISCSIDirect(def->src, pooldef) < 0)
                return -1;
            break;
        }
-- 
2.24.1





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

  Powered by Linux