qemu-cr16/tests
Fiona Ebner 6b89e851fa block: add bdrv_graph_wrlock_drained() convenience wrapper
Many write-locked sections are also drained sections. A new
bdrv_graph_wrunlock_drained() wrapper around bdrv_graph_wrunlock() is
introduced, which will begin a drained section first. A global
variable is used so bdrv_graph_wrunlock() knows if it also needs
to end such a drained section. Both the aio_poll call in
bdrv_graph_wrlock() and the aio_bh_poll() in bdrv_graph_wrunlock()
can re-enter a write-locked section. While for the latter, ending the
drain could be moved to before the call, the former requires that the
variable is a counter and not just a boolean.

Since the wrapper calls bdrv_drain_all_begin(), which must be called
with the graph unlocked, mark the wrapper as GRAPH_UNLOCKED too.

The switch to the new helpers was generated with the following
commands and then manually checked:
find . -name '*.c' -exec sed -i -z 's/bdrv_drain_all_begin();\n\s*bdrv_graph_wrlock();/bdrv_graph_wrlock_drained();/g' {} ';'
find . -name '*.c' -exec sed -i -z 's/bdrv_graph_wrunlock();\n\s*bdrv_drain_all_end();/bdrv_graph_wrunlock();/g' {} ';'

Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Message-ID: <20250530151125.955508-25-f.ebner@proxmox.com>
[kwolf: Removed redundant GRAPH_UNLOCKED]
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2025-07-14 15:40:58 +02:00
..
bench
data target/riscv/cpu.c: add 'ssstrict' to riscv, isa 2025-07-04 21:09:48 +10:00
decode
docker tests/docker: expose $HOME/.cache/qemu as docker volume 2025-06-07 15:15:30 +01:00
fp fpu: allow flushing of output denormals to be after rounding 2025-02-11 16:22:07 +00:00
functional target-arm queue: 2025-07-13 01:45:18 -04:00
guest-debug tests/tcg: Add late gdbstub attach test 2025-02-10 13:47:59 +00:00
image-fuzzer
include meson: fix Windows build 2025-06-16 13:16:27 -04:00
keys
lcitool build, dockerfiles: add support for detecting rustdoc 2025-06-03 22:42:18 +02:00
migration-stress guestperf: Add test result data into report 2025-02-14 15:19:07 -03:00
multiboot
perf/block/qcow2
qapi-schema docs/sphinx/qmp_lexer: Generalize elision syntax 2025-04-08 09:04:34 +02:00
qemu-iotests iotests: fix 240 2025-06-04 18:16:34 +02:00
qtest Migration pull request 2025-07-13 01:45:30 -04:00
rocker
tcg fpu: Process float_muladd_negate_result after rounding 2025-07-10 11:53:10 -06:00
tsan
uefi-test-tools uefi-test-tools:: Add LoongArch64 support 2025-06-01 06:38:53 -04:00
unit block: add bdrv_graph_wrlock_drained() convenience wrapper 2025-07-14 15:40:58 +02:00
vm tests/vm: update openbsd image to 7.7 2025-06-26 00:42:37 +02:00
vmstate-static-checker-data
dbus-vmstate-daemon.sh
Makefile.include Remove the remainders of the Avocado tests 2025-04-23 07:51:25 +02:00
meson.build qapi: expose all schema features to code 2025-02-10 15:45:04 +01:00
test-qht-par.c
vhost-user-bridge.c