From: Daniel P. Berrange Date: Fri, 7 Oct 2011 16:38:09 +0000 (+0100) Subject: Fix storage pool source comparison to avoid comparing with self X-Git-Tag: v0.9.7~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c85013b90d0b820fe7dc6bcbdeff8ebf9852795a;p=thirdparty%2Flibvirt.git Fix storage pool source comparison to avoid comparing with self 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 --- diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 18cbfdb579..dadc115afc 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -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) {