qemu-e2k/tests
Emanuele Giuseppe Esposito c86422c554 block: Convert bdrv_refresh_total_sectors() to co_wrapper_mixed
BlockDriver->bdrv_getlength is categorized as IO callback, and it
currently doesn't run in a coroutine. We should let it take a graph
rdlock since the callback traverses the block nodes graph, which however
is only possible in a coroutine.

Therefore turn it into a co_wrapper to move the actual function into a
coroutine where the lock can be taken.

Because now this function creates a new coroutine and polls, we need to
take the AioContext lock where it is missing, for the only reason that
internally co_wrapper calls AIO_WAIT_WHILE and it expects to release the
AioContext lock.

This is especially messy when a co_wrapper creates a coroutine and polls
in bdrv_open_driver, because this function has so many callers in so
many context that it can easily lead to deadlocks. Therefore the new
rule for bdrv_open_driver is that the caller must always hold the
AioContext lock of the given bs (except if it is a coroutine), because
the function calls bdrv_refresh_total_sectors() which is now a
co_wrapper.

Once the rwlock is ultimated and placed in every place it needs to be,
we will poll using AIO_WAIT_WHILE_UNLOCKED and remove the AioContext
lock.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230113204212.359076-7-kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-02-01 16:52:32 +01:00
..
avocado tests/avocado: add RISC-V OpenSBI boot test 2023-01-20 10:14:13 +10:00
bench cleanup: Tweak and re-run return_directly.cocci 2022-12-14 16:19:35 +01:00
data tests: acpi: aarch64: Add *.topology tables 2023-01-08 01:54:23 -05:00
decode decodetree: Extend argument set syntax to allow types 2021-05-01 11:45:35 -07:00
docker tests/docker: use prebuilt toolchain for debian-hexagon-cross 2022-12-23 15:16:31 +00:00
fp enforce use of G_GNUC_PRINTF attributes 2023-01-11 10:44:34 +01:00
guest-debug tests/guest-debug: better handle gdb crashes 2022-04-20 16:04:20 +01:00
image-fuzzer image-fuzzer: Use OSerror.strerror instead of tuple subscript 2019-11-05 16:36:11 +01:00
include tests: add missing generated sources to testqapi 2020-10-17 10:45:50 -04:00
keys tests/vm: Add Haiku test based on their vagrant images 2020-11-17 09:45:24 +01:00
lcitool ci: replace x86_64 macos-11 with aarch64 macos-12 2022-11-17 09:58:11 +01:00
migration tests/migration: remove the unused local variable 2022-10-11 12:37:12 +02:00
multiboot Remove superfluous .gitignore files 2020-10-13 12:48:17 +02:00
perf/block/qcow2
plugin tests/plugins: add instruction matching to libinsn.so 2022-02-09 12:08:42 +00:00
qapi-schema tests/qapi-schema: remove Meson workaround 2023-01-06 00:51:02 +01:00
qemu-iotests qemu-iotests: Test qemu-img bitmap/commit exit code on error 2023-02-01 16:52:15 +01:00
qtest trivial branch pull request 20230118 2023-01-19 15:05:29 +00:00
rocker
tcg First RISC-V PR for QEMU 8.0 2023-01-06 22:15:53 +00:00
tsan tests/docker: Added docker build support for TSan. 2020-06-16 14:49:05 +01:00
uefi-test-tools Remove superfluous .gitignore files 2020-10-13 12:48:17 +02:00
unit block: Convert bdrv_refresh_total_sectors() to co_wrapper_mixed 2023-02-01 16:52:32 +01:00
vm tests/vm/haiku.x86_64: Update the Haiku VM to Beta 4 2023-01-18 12:27:21 +01:00
vmstate-static-checker-data hw: Replace anti-social QOM type names 2021-03-19 15:18:43 +01:00
Makefile.include configure: move tests/tcg/Makefile.prereqs to root build directory 2022-10-06 11:53:40 +01:00
check-block.sh tests/qemu-iotests: Move the bash and sanitizer checks to meson.build 2022-04-20 09:46:54 +02:00
dbus-vmstate-daemon.sh tests: add dbus-vmstate-test 2020-01-06 18:41:32 +04:00
meson.build meson: create have_vhost_* variables 2022-05-07 07:46:58 +02:00
requirements.txt tests: install "qemu" namespace package into venv 2022-06-06 09:26:54 +02:00
test-qht-par.c
vhost-user-bridge.c error handling: Use RETRY_ON_EINTR() macro where applicable 2023-01-09 13:50:47 +01:00