diff options
| author | Emanuele Giuseppe Esposito <eesposit@redhat.com> | 2022-03-03 10:15:49 -0500 |
|---|---|---|
| committer | Kevin Wolf <kwolf@redhat.com> | 2022-03-04 18:18:25 +0100 |
| commit | f791bf7f93f25f771b4423faa2694b514c5d26c7 (patch) | |
| tree | 1f9c42588b19e53d347d22f0d4222380692d4110 /block/commit.c | |
| parent | 3b491a905664739e34d3b1f6c415225a6148c1af (diff) | |
| download | focaccia-qemu-f791bf7f93f25f771b4423faa2694b514c5d26c7.tar.gz focaccia-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 'block/commit.c')
| -rw-r--r-- | block/commit.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block/commit.c b/block/commit.c index b1fc7b908b..2ce6637ca6 100644 --- a/block/commit.c +++ b/block/commit.c @@ -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; |