Re: [libvirt] hash: failed on concurrent iterating.

2018-04-04 Thread Erik Skultety
m: libvir-list-boun...@redhat.com > > > > [mailto:libvir-list-boun...@redhat.com] > > > > On Behalf Of Michal Privoznik > > > > Sent: Wednesday, April 04, 2018 5:21 PM > > > > To: zhangzijian (Cloud); libvir-list@redhat.com > > > > Cc: huangyong (Cloud) >

Re: [libvirt] hash: failed on concurrent iterating.

2018-04-04 Thread Michal Privoznik
st@redhat.com >> Cc: huangyong (Cloud) >> Subject: Re: [libvirt] hash: failed on concurrent iterating. >> >> On 04/04/2018 11:10 AM, Zhangzijian wrote: >>> In function 'virHashForEach/virHashSearch', 'table->iterating' prevent >> concurren

Re: [libvirt] hash: failed on concurrent iterating.

2018-04-04 Thread Daniel P . Berrangé
n Behalf Of Michal Privoznik > > > Sent: Wednesday, April 04, 2018 5:21 PM > > > To: zhangzijian (Cloud); libvir-list@redhat.com > > > Cc: huangyong (Cloud) > > > Subject: Re: [libvirt] hash: failed on concurrent iterating. > > > > > > On 04/04

Re: [libvirt] hash: failed on concurrent iterating.

2018-04-04 Thread Erik Skultety
angzijian (Cloud); libvir-list@redhat.com > > Cc: huangyong (Cloud) > > Subject: Re: [libvirt] hash: failed on concurrent iterating. > > > > On 04/04/2018 11:10 AM, Zhangzijian wrote: > > > In function 'virHashForEach/virHashSearch', 'table->iterating&#x

Re: [libvirt] hash: failed on concurrent iterating.

2018-04-04 Thread Zhangzijian
> -Original Message- > From: libvir-list-boun...@redhat.com [mailto:libvir-list-boun...@redhat.com] > On Behalf Of Michal Privoznik > Sent: Wednesday, April 04, 2018 5:21 PM > To: zhangzijian (Cloud); libvir-list@redhat.com > Cc: huangyong (Cloud) > Subject: Re: [lib

Re: [libvirt] hash: failed on concurrent iterating.

2018-04-04 Thread Michal Privoznik
On 04/04/2018 11:10 AM, Zhangzijian wrote: > In function 'virHashForEach/virHashSearch', 'table->iterating' prevent > concurrent iterating. But most caller evoke it, after hold a read lock. > This will lead the second caller failed to iterate the table. So, the caller > should hold a write lock,

[libvirt] hash: failed on concurrent iterating.

2018-04-04 Thread Zhangzijian
In function 'virHashForEach/virHashSearch', 'table->iterating' prevent concurrent iterating. But most caller evoke it, after hold a read lock. This will lead the second caller failed to iterate the table. So, the caller should hold a write lock, then iterate the table. -- libvir-list mailing lis