summaryrefslogtreecommitdiffstats
path: root/blockdev.c
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito2022-03-03 16:15:49 +0100
committerKevin Wolf2022-03-04 18:18:25 +0100
commitf791bf7f93f25f771b4423faa2694b514c5d26c7 (patch)
tree1f9c42588b19e53d347d22f0d4222380692d4110 /blockdev.c
parentinclude/block/block: split header into I/O and global state API (diff)
downloadqemu-f791bf7f93f25f771b4423faa2694b514c5d26c7.tar.gz
qemu-f791bf7f93f25f771b4423faa2694b514c5d26c7.tar.xz
qemu-f791bf7f93f25f771b4423faa2694b514c5d26c7.zip
assertions for block global state API
All the global state (GS) API functions will check that qemu_in_main_thread() returns true. If not, it means that the safety of BQL cannot be guaranteed, and they need to be moved to I/O. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Message-Id: <20220303151616.325444-5-eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/blockdev.c b/blockdev.c
index 42e098b458..d601ae522e 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -658,6 +658,7 @@ void blockdev_close_all_bdrv_states(void)
/* Iterates over the list of monitor-owned BlockDriverStates */
BlockDriverState *bdrv_next_monitor_owned(BlockDriverState *bs)
{
+ GLOBAL_STATE_CODE();
return bs ? QTAILQ_NEXT(bs, monitor_list)
: QTAILQ_FIRST(&monitor_bdrv_states);
}