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