qemu-e2k/include/block
Emanuele Giuseppe Esposito 1e97be9156 block: Convert bdrv_is_inserted() to co_wrapper
bdrv_is_inserted() is categorized as an I/O function, and it currently
doesn't run in a coroutine. We should let it take a graph rdlock since
it 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.

At the same time, add also blk_is_inserted as co_wrapper_mixed, since it
is called in both coroutine and non-coroutine contexts.

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 c_w_mixed_bdrv_rdlock calls AIO_WAIT_WHILE and it expects to
release the AioContext lock. 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-5-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
..
accounting.h block: pass OnOffAuto instead of bool to block_acct_setup() 2022-09-30 18:02:30 +02:00
aio_task.h coroutine: Move coroutine_fn to qemu/osdep.h, trim includes 2023-01-19 10:18:28 +01:00
aio-wait.h aio-wait.h: introduce AIO_WAIT_WHILE_UNLOCKED 2022-10-07 12:11:41 +02:00
aio.h coroutine: Use Coroutine typedef name instead of structure tag 2023-01-20 07:23:45 +01:00
block_backup.h include/block: Untangle inclusion loops 2023-01-20 07:24:28 +01:00
block_int-common.h block: Convert bdrv_is_inserted() to co_wrapper 2023-02-01 16:52:32 +01:00
block_int-global-state.h include/block: Untangle inclusion loops 2023-01-20 07:24:28 +01:00
block_int-io.h include/block: Untangle inclusion loops 2023-01-20 07:24:28 +01:00
block_int.h include/block: Untangle inclusion loops 2023-01-20 07:24:28 +01:00
block-common.h block: Add no_coroutine_fn and coroutine_mixed_fn marker 2023-01-24 18:26:41 +01:00
block-copy.h include/block: Untangle inclusion loops 2023-01-20 07:24:28 +01:00
block-global-state.h include/block: Untangle inclusion loops 2023-01-20 07:24:28 +01:00
block-hmp-cmds.h include/block: Untangle inclusion loops 2023-01-20 07:24:28 +01:00
block-io.h block: Convert bdrv_is_inserted() to co_wrapper 2023-02-01 16:52:32 +01:00
block.h include/block: Untangle inclusion loops 2023-01-20 07:24:28 +01:00
blockjob_int.h include/block: Untangle inclusion loops 2023-01-20 07:24:28 +01:00
blockjob.h include/block: Untangle inclusion loops 2023-01-20 07:24:28 +01:00
dirty-bitmap.h include/block: Untangle inclusion loops 2023-01-20 07:24:28 +01:00
export.h block/export: Move blk to BlockExport 2020-10-02 15:46:40 +02:00
fuse.h fuse: Allow exporting BDSs via FUSE 2020-12-11 17:52:39 +01:00
graph-lock.h coroutine: Move coroutine_fn to qemu/osdep.h, trim includes 2023-01-19 10:18:28 +01:00
nbd.h nbd: remove incorrect coroutine_fn annotations 2022-10-07 12:11:40 +02:00
nvme.h nvme: Fix misleading macro when mixed with ternary operator 2022-07-15 10:40:33 +02:00
qapi.h include/block: Untangle inclusion loops 2023-01-20 07:24:28 +01:00
qdict.h include: move qdict_{crumple,flatten} declarations 2022-04-21 17:03:51 +04:00
raw-aio.h coroutine: Clean up superfluous inclusion of qemu/coroutine.h 2023-01-19 10:18:28 +01:00
replication.h replication: move include out of root directory 2021-05-26 14:49:46 +02:00
reqlist.h block/reqlist: add reqlist_wait_all() 2022-03-07 09:33:30 +01:00
snapshot.h include/block/snapshot: global state API + assertions 2022-03-04 18:18:25 +01:00
thread-pool.h include/block: Untangle inclusion loops 2023-01-20 07:24:28 +01:00
throttle-groups.h include/block: Untangle inclusion loops 2023-01-20 07:24:28 +01:00
write-threshold.h write-threshold: deal with includes 2021-05-14 16:14:10 +02:00