[libvirt] [PATCH v1 02/11] virStoragePoolObjListForEach: Grab a reference for pool object

Ján Tomko jtomko at redhat.com
Mon Aug 19 14:17:08 UTC 2019


On Fri, May 24, 2019 at 04:35:38PM +0200, Michal Privoznik wrote:
>Turns out there's one callback that might remove a storage pool
>during its run: storagePoolUpdateAllState() call
>storagePoolUpdateStateCallback() which may call
>virStoragePoolUpdateInactive() which in turn may call
>virStoragePoolObjRemove(). Problem is that the
>UpdateStateCallback() sees a storage pool object with just two
>references: one for each hash table holding the object. If the
>function ends up calling ObjRemove() then upon removing the
>object from hash tables those references are gone and thus any
>subsequent call touching the object is invalid.
>
>The solution to this problem is to grab reference for the object
>we are running iterator with.
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> src/conf/virstorageobj.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190819/38e51379/attachment-0001.sig>


More information about the libvir-list mailing list