]> git.proxmox.com Git - mirror_qemu.git/commit
block: Introduce bdrv_co_change_backing_file()
authorKevin Wolf <kwolf@redhat.com>
Fri, 27 Oct 2023 15:53:28 +0000 (17:53 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 8 Nov 2023 16:56:17 +0000 (17:56 +0100)
commite2dd273754eb9a47c33660b4e14074e8e96ada4d
treee637b007eaa807c7f8073a3f2173273efeb937de
parent244b26d259bc56097b2d82690847cb7657e22830
block: Introduce bdrv_co_change_backing_file()

bdrv_change_backing_file() is called both inside and outside coroutine
context. This makes it difficult for it to take the graph lock
internally. It also means that driver implementations need to be able to
run outside of coroutines, too. Switch it to the usual model with a
coroutine based implementation and a co_wrapper instead. The new
function is marked GRAPH_RDLOCK.

As the co_wrapper now runs the function in the AioContext of the node
(as it should always have done), this is not GLOBAL_STATE_CODE() any
more.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20231027155333.420094-20-kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
block/qcow2.c
block/qed.c
include/block/block-global-state.h
include/block/block-io.h
include/block/block_int-common.h
tests/unit/test-bdrv-drain.c