[PATCH 4/9] virDomainDiskAddISCSIPoolSourceHost: Remove ternary operator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 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 1c52d7f347..5ef12c7ee7 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -31342,8 +31342,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.24.1





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux