block: Add assertion for bdrv_graph_wrlock()
commite6e964b8b021446c8d3d1f91c0208f653e9ec92c
authorKevin Wolf <kwolf@redhat.com>
Fri, 29 Sep 2023 14:51:57 +0000 (29 16:51 +0200)
committerKevin Wolf <kwolf@redhat.com>
Thu, 12 Oct 2023 14:31:33 +0000 (12 16:31 +0200)
treeb9c929a6359b628c374bb7e71bd9b8b1517e16b5
parent680e0cc40c5830ebcbfa0bce99bf932e1a4cf6c6
block: Add assertion for bdrv_graph_wrlock()

bdrv_graph_wrlock() can't run in a coroutine (because it polls) and
requires holding the BQL. We already have GLOBAL_STATE_CODE() to assert
the latter. Assert the former as well and add a no_coroutine_fn marker.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20230929145157.45443-23-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/graph-lock.c
include/block/graph-lock.h