qemu-e2k/include
Kevin Wolf 6bc0bcc89f block: Fix deadlocks in bdrv_graph_wrunlock()
bdrv_graph_wrunlock() calls aio_poll(), which may run callbacks that
have a nested event loop. Nested event loops can depend on other
iothreads making progress, so in order to allow them to make progress it
must not hold the AioContext lock of another thread while calling
aio_poll().

This introduces a @bs parameter to bdrv_graph_wrunlock() whose
AioContext is temporarily dropped (which matches bdrv_graph_wrlock()),
and a bdrv_graph_wrunlock_ctx() that can be used if the BlockDriverState
doesn't necessarily exist any more when unlocking.

This also requires a change to bdrv_schedule_unref(), which was relying
on the incorrectly taken lock. It needs to take the lock itself now.
While this is a separate bug, it can't be fixed a separate patch because
otherwise the intermediate state would either deadlock or try to release
a lock that we don't even hold.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20231115172012.112727-3-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[kwolf: Fixed up bdrv_schedule_unref()]
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-11-21 12:45:21 +01:00
..
authz
block block: Fix deadlocks in bdrv_graph_wrunlock() 2023-11-21 12:45:21 +01:00
chardev
crypto
disas
exec accel/tcg: Remove CF_LAST_IO 2023-11-14 10:40:54 -08:00
fpu
gdbstub gdbstub: replace exit calls with proper shutdown for softmmu 2023-10-12 12:36:37 +10:00
hw include/hw/virtio/vhost.h: spelling fix: sate 2023-11-15 12:06:05 +03:00
io
libdecnumber
migration migration: per-mode blockers 2023-11-01 16:13:59 +01:00
monitor
net net/net: Clean up global variable shadowing 2023-10-06 13:27:43 +02:00
qapi
qemu host/include/generic/host/atomic128: Fix compilation problem with Clang 17 2023-11-13 11:35:47 +01:00
qom qom: Add object_property_set_default_list() 2023-11-10 18:19:14 +01:00
scsi
semihosting * util/log: re-allow switching away from stderr log file 2023-10-09 10:11:18 -04:00
standard-headers
sysemu dump: Add arch cleanup function 2023-11-14 10:42:32 +01:00
tcg tcg: Remove TCG_TARGET_HAS_neg_{i32,i64} 2023-11-06 08:27:21 -08:00
ui virtio-gpu: replace PIXMAN for region/rect test 2023-11-07 14:04:25 +04:00
user
elf.h
glib-compat.h
qemu-io.h
qemu-main.h