render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From 6502a0a52ec29cffc819254b71bea4f5b2fbd5ce Mon Sep 17 00:00:00 2001
Message-Id: <6502a0a52ec29cffc819254b71bea4f5b2fbd5ce@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Wed, 19 Feb 2020 15:09:56 +0100
Subject: [PATCH] virDomainDiskAddISCSIPoolSourceHost: Remove ternary operator
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit e20c5b17037acca0cfffd983c0bcdd0ee5b7e628)

https://bugzilla.redhat.com/show_bug.cgi?id=1804603
Message-Id: <bddaa981eda3b5145d460711aaf366f360fd155b.1582120424.git.pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/conf/domain_conf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 436d094578..89f1e44536 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -31189,8 +31189,10 @@ virDomainDiskAddISCSIPoolSourceHost(virDomainDiskDefPtr def,
 
     def->src->hosts[0].name = g_strdup(pooldef->source.hosts[0].name);
 
-    def->src->hosts[0].port = pooldef->source.hosts[0].port ?
-        pooldef->source.hosts[0].port : 3260;
+    if (pooldef->source.hosts[0].port != 0)
+        def->src->hosts[0].port = pooldef->source.hosts[0].port;
+    else
+        def->src->hosts[0].port = 3260;
 
     /* iscsi volume has name like "unit:0:0:1" */
     if (!(tokens = virStringSplitCount(def->src->srcpool->volume, ":", 0, &ntokens)))
-- 
2.25.0