render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
fbe740
From 6502a0a52ec29cffc819254b71bea4f5b2fbd5ce Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <6502a0a52ec29cffc819254b71bea4f5b2fbd5ce@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Wed, 19 Feb 2020 15:09:56 +0100
fbe740
Subject: [PATCH] virDomainDiskAddISCSIPoolSourceHost: Remove ternary operator
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
(cherry picked from commit e20c5b17037acca0cfffd983c0bcdd0ee5b7e628)
fbe740
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1804603
fbe740
Message-Id: <bddaa981eda3b5145d460711aaf366f360fd155b.1582120424.git.pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 src/conf/domain_conf.c | 6 ++++--
fbe740
 1 file changed, 4 insertions(+), 2 deletions(-)
fbe740
fbe740
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
fbe740
index 436d094578..89f1e44536 100644
fbe740
--- a/src/conf/domain_conf.c
fbe740
+++ b/src/conf/domain_conf.c
fbe740
@@ -31189,8 +31189,10 @@ virDomainDiskAddISCSIPoolSourceHost(virDomainDiskDefPtr def,
fbe740
 
fbe740
     def->src->hosts[0].name = g_strdup(pooldef->source.hosts[0].name);
fbe740
 
fbe740
-    def->src->hosts[0].port = pooldef->source.hosts[0].port ?
fbe740
-        pooldef->source.hosts[0].port : 3260;
fbe740
+    if (pooldef->source.hosts[0].port != 0)
fbe740
+        def->src->hosts[0].port = pooldef->source.hosts[0].port;
fbe740
+    else
fbe740
+        def->src->hosts[0].port = 3260;
fbe740
 
fbe740
     /* iscsi volume has name like "unit:0:0:1" */
fbe740
     if (!(tokens = virStringSplitCount(def->src->srcpool->volume, ":", 0, &ntokens)))
fbe740
-- 
fbe740
2.25.0
fbe740