Re: error : virHashForEach:597 : Hash operation not allowed during iteration

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

 



 ❦  4 avril 2018 16:21 +0200, Vincent Bernat <bernat@xxxxxxxx> :

>> You can do that locally, but as a patch it's very unlikely to be
>> accepted upstream because we've introduced RW locks to be able to access
>> domain list from multiple threads.
>
> Looking a bit more, the whole "iterating" bit is currently
> unsafe. First, it is racy since it's "check then take". Two threads may
> check the value is false and start iterating both. Moreover, at some
> places, it is not set, for example in virHashAddOrUpdateEntry(). So, it
> would be possible to call this function and during the update to iterate
> over the hash. This seems to be prevented only by callers using RW
> lock. So, it seems we can just remove this "iterating" bool and just
> check all users of these functions are using the appropriate lock.

My bad, I didn't see the use of table->current...
-- 
The only way to keep your health is to eat what you don't want, drink what
you don't like, and do what you'd rather not.
		-- Mark Twain

_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users




[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux