Blame SOURCES/libvirt-virDomainDiskTranslateISCSIDirect-Take-virStorageSourcePtr-instead-of-virDomainDiskDefPtr.patch

d76c62
From 452599b446bb9725e1b3b95d7733353b0d76c12f Mon Sep 17 00:00:00 2001
d76c62
Message-Id: <452599b446bb9725e1b3b95d7733353b0d76c12f@dist-git>
d76c62
From: Peter Krempa <pkrempa@redhat.com>
d76c62
Date: Wed, 19 Feb 2020 15:09:59 +0100
d76c62
Subject: [PATCH] virDomainDiskTranslateISCSIDirect: Take virStorageSourcePtr
d76c62
 instead of virDomainDiskDefPtr
d76c62
MIME-Version: 1.0
d76c62
Content-Type: text/plain; charset=UTF-8
d76c62
Content-Transfer-Encoding: 8bit
d76c62
d76c62
Only 'def->src' was ever used in this function. Use the source directly.
d76c62
d76c62
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
d76c62
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d76c62
(cherry picked from commit bc42d88ffdef84a823092bfb35cd6bce39747366)
d76c62
d76c62
https://bugzilla.redhat.com/show_bug.cgi?id=1804603
d76c62
Message-Id: <6a9c4a227bb1ea5564bfb03d076b080d879239b4.1582120424.git.pkrempa@redhat.com>
d76c62
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d76c62
---
d76c62
 src/conf/domain_conf.c | 22 +++++++++++-----------
d76c62
 1 file changed, 11 insertions(+), 11 deletions(-)
d76c62
d76c62
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
d76c62
index 14b675d5d6..68dd640dc5 100644
d76c62
--- a/src/conf/domain_conf.c
d76c62
+++ b/src/conf/domain_conf.c
d76c62
@@ -31239,30 +31239,30 @@ virDomainDiskTranslateSourcePoolAuth(virStorageSourcePtr src,
d76c62
 
d76c62
 
d76c62
 static int
d76c62
-virDomainDiskTranslateISCSIDirect(virDomainDiskDefPtr def,
d76c62
+virDomainDiskTranslateISCSIDirect(virStorageSourcePtr src,
d76c62
                                   virStoragePoolDefPtr pooldef)
d76c62
 {
d76c62
-    def->src->srcpool->actualtype = VIR_STORAGE_TYPE_NETWORK;
d76c62
-    def->src->protocol = VIR_STORAGE_NET_PROTOCOL_ISCSI;
d76c62
+    src->srcpool->actualtype = VIR_STORAGE_TYPE_NETWORK;
d76c62
+    src->protocol = VIR_STORAGE_NET_PROTOCOL_ISCSI;
d76c62
 
d76c62
-    if (virDomainDiskTranslateSourcePoolAuth(def->src,
d76c62
+    if (virDomainDiskTranslateSourcePoolAuth(src,
d76c62
                                              &pooldef->source) < 0)
d76c62
         return -1;
d76c62
 
d76c62
     /* Source pool may not fill in the secrettype field,
d76c62
      * so we need to do so here
d76c62
      */
d76c62
-    if (def->src->auth && !def->src->auth->secrettype) {
d76c62
+    if (src->auth && !src->auth->secrettype) {
d76c62
         const char *secrettype =
d76c62
             virSecretUsageTypeToString(VIR_SECRET_USAGE_TYPE_ISCSI);
d76c62
-        def->src->auth->secrettype = g_strdup(secrettype);
d76c62
+        src->auth->secrettype = g_strdup(secrettype);
d76c62
     }
d76c62
 
d76c62
-    if (virDomainDiskAddISCSIPoolSourceHost(def->src, pooldef) < 0)
d76c62
+    if (virDomainDiskAddISCSIPoolSourceHost(src, pooldef) < 0)
d76c62
         return -1;
d76c62
 
d76c62
-    if (!def->src->initiator.iqn && pooldef->source.initiator.iqn &&
d76c62
-        virStorageSourceInitiatorCopy(&def->src->initiator,
d76c62
+    if (!src->initiator.iqn && pooldef->source.initiator.iqn &&
d76c62
+        virStorageSourceInitiatorCopy(&src->initiator,
d76c62
                                       &pooldef->source.initiator) < 0) {
d76c62
         return -1;
d76c62
     }
d76c62
@@ -31387,7 +31387,7 @@ virDomainDiskTranslateSourcePool(virDomainDiskDefPtr def)
d76c62
             return -1;
d76c62
         }
d76c62
 
d76c62
-        if (virDomainDiskTranslateISCSIDirect(def, pooldef) < 0)
d76c62
+        if (virDomainDiskTranslateISCSIDirect(def->src, pooldef) < 0)
d76c62
             return -1;
d76c62
 
d76c62
         break;
d76c62
@@ -31412,7 +31412,7 @@ virDomainDiskTranslateSourcePool(virDomainDiskDefPtr def)
d76c62
            break;
d76c62
 
d76c62
        case VIR_STORAGE_SOURCE_POOL_MODE_DIRECT:
d76c62
-           if (virDomainDiskTranslateISCSIDirect(def, pooldef) < 0)
d76c62
+           if (virDomainDiskTranslateISCSIDirect(def->src, pooldef) < 0)
d76c62
                return -1;
d76c62
            break;
d76c62
        }
d76c62
-- 
d76c62
2.25.0
d76c62