]> git.ipfire.org Git - thirdparty/qemu.git/commit
block: move drain outside of bdrv_set_backing_hd_drained()
authorFiona Ebner <f.ebner@proxmox.com>
Fri, 30 May 2025 15:10:48 +0000 (17:10 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 4 Jun 2025 16:16:34 +0000 (18:16 +0200)
commite66dbda11eab2b4a091d470f3508a4d6ca60eaf5
tree83c598411fed614b97afdb7dfa27caee49b84f6d
parent2b833595aa21679145cfe67ba720113b165c19ef
block: move drain outside of bdrv_set_backing_hd_drained()

This is part of resolving the deadlock mentioned in commit "block:
move draining out of bdrv_change_aio_context() and mark GRAPH_RDLOCK".

The function bdrv_set_backing_hd_drained() holds the graph lock, so it
is not allowed to drain. It is called by:
1. bdrv_set_backing_hd(), where a drained section is introduced,
   replacing the previously present bs-specific drains.
2. stream_prepare(), where a drained section is introduced replacing
   the previously present bs-specific drains.

The drain_bs variable in bdrv_set_backing_hd_drained() is now
superfluous and thus dropped.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Message-ID: <20250530151125.955508-12-f.ebner@proxmox.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
block/stream.c