]> git.proxmox.com Git - mirror_qemu.git/commit - util/aio-posix.c
aio-posix: Fix concurrent aio_poll/set_fd_handler.
authorRemy Noel <remy.noel@blade-group.com>
Thu, 20 Dec 2018 15:20:30 +0000 (16:20 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 14 Jan 2019 14:09:41 +0000 (14:09 +0000)
commitfef1660132b0f25bf2d275d7f986ddcfe19a4426
tree3aa14f19cea3740b70df72d1751d5b50200711d2
parent8821b34a7362d69b325c045dad4557782775683b
aio-posix: Fix concurrent aio_poll/set_fd_handler.

It is possible for an io_poll callback to be concurrently executed along
with an aio_set_fd_handlers. This can cause all sorts of problems, like
a NULL callback or a bad opaque pointer.

This changes set_fd_handlers so that it no longer modify existing handlers
entries and instead, always insert those after having proper initialisation.

Tested-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Remy Noel <remy.noel@blade-group.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20181220152030.28035-3-remy.noel@blade-group.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
util/aio-posix.c
util/aio-win32.c