]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
conf: Adjust duplicate source host port check
authorJohn Ferlan <jferlan@redhat.com>
Mon, 11 May 2015 14:19:39 +0000 (10:19 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 12 May 2015 20:16:48 +0000 (16:16 -0400)
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

index 4852dfbf022314b59f64ebb050b73b2bc326b1e2..61365b9ca4e27971e06c62f8198d3477a98f187a 100644 (file)
@@ -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);