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

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