ed6e216171
laio_init() can fail for a couple of reasons, which will lead to a NULL pointer dereference in laio_attach_aio_context(). To solve this, add a aio_setup_linux_aio() function which is called early in raw_open_common. If this fails, propagate the error up. The signature of aio_get_linux_aio() was not modified, because it seems preferable to return the actual errno from the possible failing initialization calls. Additionally, when the AioContext changes, we need to associate a LinuxAioState with the new AioContext. Use the bdrv_attach_aio_context callback and call the new aio_setup_linux_aio(), which will allocate a new AioContext if needed, and return errors on failures. If it fails for any reason, fallback to threaded AIO with an error message, as the device is already in-use by the guest. Add an assert that aio_get_linux_aio() cannot return NULL. Signed-off-by: Nishanth Aravamudan <naravamudan@digitalocean.com> Message-id: 20180622193700.6523-1-naravamudan@digitalocean.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
||
---|---|---|
.. | ||
acl.c | ||
aio-posix.c | ||
aio-wait.c | ||
aio-win32.c | ||
aiocb.c | ||
async.c | ||
base64.c | ||
bitmap.c | ||
bitops.c | ||
buffer.c | ||
bufferiszero.c | ||
cacheinfo.c | ||
compatfd.c | ||
coroutine-sigaltstack.c | ||
coroutine-ucontext.c | ||
coroutine-win32.c | ||
crc32c.c | ||
cutils.c | ||
envlist.c | ||
error.c | ||
event_notifier-posix.c | ||
event_notifier-win32.c | ||
fifo8.c | ||
getauxval.c | ||
hbitmap.c | ||
hexdump.c | ||
host-utils.c | ||
id.c | ||
iohandler.c | ||
iov.c | ||
iova-tree.c | ||
keyval.c | ||
lockcnt.c | ||
log.c | ||
main-loop.c | ||
Makefile.objs | ||
memfd.c | ||
mmap-alloc.c | ||
module.c | ||
notify.c | ||
osdep.c | ||
oslib-posix.c | ||
oslib-win32.c | ||
pagesize.c | ||
path.c | ||
qdist.c | ||
qemu-config.c | ||
qemu-coroutine-io.c | ||
qemu-coroutine-lock.c | ||
qemu-coroutine-sleep.c | ||
qemu-coroutine.c | ||
qemu-error.c | ||
qemu-openpty.c | ||
qemu-option.c | ||
qemu-progress.c | ||
qemu-sockets.c | ||
qemu-thread-posix.c | ||
qemu-thread-win32.c | ||
qemu-timer-common.c | ||
qemu-timer.c | ||
qht.c | ||
range.c | ||
rcu.c | ||
readline.c | ||
stats64.c | ||
sys_membarrier.c | ||
systemd.c | ||
thread-pool.c | ||
throttle.c | ||
timed-average.c | ||
trace-events | ||
unicode.c | ||
uri.c | ||
uuid.c | ||
vfio-helpers.c |