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

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