mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-27 17:59:49 -07:00
This is part of resolving the deadlock mentioned in commit "block: move draining out of bdrv_change_aio_context() and mark GRAPH_RDLOCK". Convert the function to a _locked() version that has to be called with the graph lock held and add a convenience wrapper that has to be called with the graph unlocked, which drains and takes the lock itself. Since bdrv_try_change_aio_context() is global state code, the wrapper is too. Callers are adapted to use the appropriate variant, depending on whether the caller already holds the lock. In the test_set_aio_context() unit test, prior drains can be removed, because draining already happens inside the new wrapper. Note that bdrv_attach_child_common_abort(), bdrv_attach_child_common() and bdrv_root_unref_child() hold the graph lock and are not actually allowed to drain either. This will be addressed in the following commits. Functions like qmp_blockdev_mirror() query the nodes to act on before draining and locking. In theory, draining could invalidate those nodes. This kind of issue is not addressed by these commits. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-ID: <20250530151125.955508-10-f.ebner@proxmox.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> |
||
|---|---|---|
| .. | ||
| accounting.h | ||
| aio-wait.h | ||
| aio.h | ||
| aio_task.h | ||
| block-common.h | ||
| block-copy.h | ||
| block-global-state.h | ||
| block-hmp-cmds.h | ||
| block-io.h | ||
| block.h | ||
| block_backup.h | ||
| block_int-common.h | ||
| block_int-global-state.h | ||
| block_int-io.h | ||
| block_int.h | ||
| blockjob.h | ||
| blockjob_int.h | ||
| dirty-bitmap.h | ||
| export.h | ||
| fuse.h | ||
| graph-lock.h | ||
| nbd.h | ||
| nvme.h | ||
| qapi.h | ||
| qdict.h | ||
| raw-aio.h | ||
| replication.h | ||
| reqlist.h | ||
| snapshot.h | ||
| thread-pool.h | ||
| throttle-groups.h | ||
| ufs.h | ||
| write-threshold.h | ||