From 6dd9297c88c8898a2505bc3bb95fb62d577e7c25 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Mon, 11 May 2015 10:19:39 -0400 Subject: [PATCH] conf: Adjust duplicate source host port check Only perform the port number check if the incoming definition actually provides it. Since the port number is optional we could erroneously pass a duplicate source host check since some storage pool backends which fill in the default port number (e.g., iSCSI and sheepdog) for the started pool. --- src/conf/storage_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 4852dfbf0..61365b9ca 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -2412,7 +2412,8 @@ virStoragePoolSourceMatchSingleHost(virStoragePoolSourcePtr poolsrc, if (poolsrc->nhost != 1 && defsrc->nhost != 1) return false; - if (poolsrc->hosts[0].port != defsrc->hosts[0].port) + if (defsrc->hosts[0].port && + poolsrc->hosts[0].port != defsrc->hosts[0].port) return false; return STREQ(poolsrc->hosts[0].name, defsrc->hosts[0].name); -- 2.39.5