[libvirt] [PATCH v2 6/8] storage: Add duplicate host check for Sheepdog pool def

John Ferlan jferlan at redhat.com
Mon Apr 13 21:21:10 UTC 2015


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.

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/conf/storage_conf.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 1fadff4..2b2104d 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -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:
-- 
2.1.0




More information about the libvir-list mailing list