]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix storage pool source comparison to avoid comparing with self
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 7 Oct 2011 16:38:09 +0000 (17:38 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 1 Nov 2011 11:13:29 +0000 (11:13 +0000)
If we are comparing storage pools we must skip comparing with
ourself, so that re-defining an existing pool works

* conf/storage_conf.c: Skip self when comparing

src/conf/storage_conf.c

index 18cbfdb579eeb1cdbc6a21c92091d29797dee697..dadc115afc3375897c1eac9f7318b24c4a0a232a 100644 (file)
@@ -1711,6 +1711,10 @@ int virStoragePoolSourceFindDuplicate(virStoragePoolObjListPtr pools,
         if (def->type != pool->def->type)
             continue;
 
+        /* Don't mach against ourself if re-defining existing pool ! */
+        if (STREQ(pool->def->name, def->name))
+            continue;
+
         virStoragePoolObjLock(pool);
 
         switch (pool->def->type) {