]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
storage: Add duplicate host check for Sheepdog pool def
authorJohn Ferlan <jferlan@redhat.com>
Thu, 2 Apr 2015 16:46:00 +0000 (12:46 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 15 Apr 2015 10:40:08 +0000 (06:40 -0400)
Check the proposed pool source host XML definition against existing sheepdog
pools to ensure the incoming definition doesn't use the same source host XML
definition as an existing pool.

src/conf/storage_conf.c

index 1fadff49557387b6036fdf5eb555bb9e9cdd213f..2b2104d536491e85201cbd74709b89f09b82bfaa 100644 (file)
@@ -2544,9 +2544,13 @@ virStoragePoolSourceFindDuplicate(virConnectPtr conn,
         case VIR_STORAGE_POOL_DISK:
             matchpool = virStoragePoolSourceFindDuplicateDevices(pool, def);
             break;
+        case VIR_STORAGE_POOL_SHEEPDOG:
+            if (virStoragePoolSourceMatchSingleHost(&pool->def->source,
+                                                    &def->source))
+                matchpool = pool;
+            break;
         case VIR_STORAGE_POOL_MPATH:
         case VIR_STORAGE_POOL_RBD:
-        case VIR_STORAGE_POOL_SHEEPDOG:
         case VIR_STORAGE_POOL_GLUSTER:
         case VIR_STORAGE_POOL_ZFS:
         case VIR_STORAGE_POOL_LAST: