From c85013b90d0b820fe7dc6bcbdeff8ebf9852795a Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 7 Oct 2011 17:38:09 +0100 Subject: [PATCH] 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 --- src/conf/storage_conf.c | 4 ++++ 1 file changed, 4 insertions(+) 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) {