render / rpms / libvirt

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