[libvirt] [PATCH] storage: Break out the loop if duplicate pool is found
 
            It doesn't break out the "for" loop even if duplicate pool is found, and thus the "matchpool" could be overriden as NULL again if there is different pool afterwards. To address the problem in libvirt-user list: https://www.redhat.com/archives/libvirt-users/2012-April/msg00150.html --- src/conf/storage_conf.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 7579327..9a42e34 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -1710,6 +1710,9 @@ int virStoragePoolSourceFindDuplicate(virStoragePoolObjListPtr pools, break; } virStoragePoolObjUnlock(pool); + + if (matchpool) + break; } if (matchpool) { -- 1.7.7.3
 
            On 28.04.2012 10:22, Osier Yang wrote:
It doesn't break out the "for" loop even if duplicate pool is found, and thus the "matchpool" could be overriden as NULL again if there is different pool afterwards.
To address the problem in libvirt-user list:
https://www.redhat.com/archives/libvirt-users/2012-April/msg00150.html --- src/conf/storage_conf.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
ACK Michal
 
            On 2012年04月28日 17:06, Michal Privoznik wrote:
On 28.04.2012 10:22, Osier Yang wrote:
It doesn't break out the "for" loop even if duplicate pool is found, and thus the "matchpool" could be overriden as NULL again if there is different pool afterwards.
To address the problem in libvirt-user list:
https://www.redhat.com/archives/libvirt-users/2012-April/msg00150.html --- src/conf/storage_conf.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
ACK
Michal
Thanks, pushed. Osier
participants (2)
- 
                 Michal Privoznik Michal Privoznik
- 
                 Osier Yang Osier Yang