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>
This commit is contained in:
Emanuele Giuseppe Esposito 2022-03-03 10:15:49 -05:00 committed by Kevin Wolf
parent 3b491a9056
commit f791bf7f93
4 changed files with 137 additions and 2 deletions

View file

@ -432,6 +432,8 @@ int bdrv_commit(BlockDriverState *bs)
QEMU_AUTO_VFREE uint8_t *buf = NULL;
Error *local_err = NULL;
GLOBAL_STATE_CODE();
if (!drv)
return -ENOMEDIUM;