Re: [PATCH] Fix storage pool source comparison to avoid comparing with self

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/11/2011 04:26 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange"<berrange@xxxxxxxxxx>

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 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index e893b2d..eb39198 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -1730,6 +1730,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;

ACK.

--
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]