qemu-e2k/stubs
Nishanth Aravamudan ed6e216171 linux-aio: properly bubble up errors from initialization
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>
2018-06-27 13:06:34 +01:00
..
Makefile.objs pc-dimm: factor out MemoryDevice interface 2018-05-07 10:00:02 -03:00
arch-query-cpu-def.c Include qapi/error.h exactly where needed 2018-02-09 13:50:17 +01:00
arch-query-cpu-model-baseline.c Include qapi/error.h exactly where needed 2018-02-09 13:50:17 +01:00
arch-query-cpu-model-comparison.c Include qapi/error.h exactly where needed 2018-02-09 13:50:17 +01:00
arch-query-cpu-model-expansion.c Include qapi/error.h exactly where needed 2018-02-09 13:50:17 +01:00
bdrv-next-monitor-owned.c
blk-commit-all.c
blockdev-close-all-bdrv-states.c
change-state-handler.c stubs: Add vm state change handler stubs 2017-08-15 10:03:27 -05:00
clock-warp.c
cpu-get-clock.c
cpu-get-icount.c cpus: define QEMUTimerListNotifyCB for QEMU system emulation 2017-03-14 13:28:29 +01:00
dump.c Include qmp-commands.h exactly where needed 2018-02-09 13:52:10 +01:00
error-printf.c
fd-register.c
fdset.c monitor: add lock to protect mon_fdsets 2018-06-18 15:48:22 +02:00
gdbstub.c
get-vm-name.c
iothread-lock.c
iothread.c
is-daemonized.c
linux-aio.c linux-aio: properly bubble up errors from initialization 2018-06-27 13:06:34 +01:00
machine-init-done.c vl: export machine_init_done 2018-03-12 16:12:46 +01:00
migr-blocker.c migration: Create migration/blocker.h 2017-05-17 12:04:59 +02:00
monitor.c
notify-event.c
pc_madt_cpu_entry.c
pci-host-piix.c hw/acpi: Move acpi_set_pci_info to pcihp 2017-09-08 16:15:17 +03:00
qmp_memory_device.c pc-dimm: factor out MemoryDevice interface 2018-05-07 10:00:02 -03:00
qtest.c
ram-block.c stubs: Add stubs for ram block API 2018-02-08 09:22:03 +08:00
replay.c replay: make locking visible outside replay code 2018-03-12 16:12:50 +01:00
runstate-check.c
set-fd-handler.c block: move AioContext, QEMUTimer, main-loop to libqemuutil 2017-02-21 11:14:07 +00:00
slirp.c
sysbus.c
target-get-monitor-def.c
target-monitor-defs.c
tpm.c Include less of the generated modular QAPI headers 2018-03-02 13:45:50 -06:00
trace-control.c
uuid.c qapi: Empty out qapi-schema.json 2018-03-02 13:45:50 -06:00
vm-stop.c
vmgenid.c qapi: Empty out qapi-schema.json 2018-03-02 13:45:50 -06:00
vmstate.c migration: Move check_migratable() into qdev.c 2017-05-17 12:04:59 +02:00
xen-common.c move xen-common.c to hw/xen/ 2017-04-25 11:04:34 -07:00
xen-hvm.c qapi: Empty out qapi-schema.json 2018-03-02 13:45:50 -06:00