]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: storage: Fix duplicate check for gluster pools
authorPeter Krempa <pkrempa@redhat.com>
Tue, 30 Jun 2015 08:14:17 +0000 (10:14 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 30 Jun 2015 12:02:17 +0000 (14:02 +0200)
The pool name has to be the same too to warrant rejecting a pool
definition as duplicate. This regression was introduced in commit
2184ade3a0546b915252cb3b6a5dc88e9a8d2ccf.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1236438

src/conf/storage_conf.c

index 4bbed4f3a7f7139d0b48e52945ba73ba8e2ebc44..a7476a30d73eb5e7429800c150dc67c2f1328731 100644 (file)
@@ -2471,13 +2471,22 @@ virStoragePoolSourceFindDuplicate(virConnectPtr conn,
             if (STREQ(pool->def->target.path, def->target.path))
                 matchpool = pool;
             break;
-        case VIR_STORAGE_POOL_NETFS:
+
         case VIR_STORAGE_POOL_GLUSTER:
+            if (STREQ(pool->def->source.name, def->source.name) &&
+                STREQ_NULLABLE(pool->def->source.dir, def->source.dir) &&
+                virStoragePoolSourceMatchSingleHost(&pool->def->source,
+                                                    &def->source))
+                matchpool = pool;
+            break;
+
+        case VIR_STORAGE_POOL_NETFS:
             if (STREQ(pool->def->source.dir, def->source.dir) &&
                 virStoragePoolSourceMatchSingleHost(&pool->def->source,
                                                     &def->source))
                 matchpool = pool;
             break;
+
         case VIR_STORAGE_POOL_SCSI:
             if (pool->def->source.adapter.type ==
                 VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_FC_HOST &&