Re: [PATCH v4 03/25] assertions for block global state API

2021-11-15 Thread Hanna Reitz
On 15.11.21 13:27, Emanuele Giuseppe Esposito wrote: @@ -586,12 +589,14 @@ void bdrv_unapply_subtree_drain(BdrvChild *child, BlockDriverState *old_parent)   void coroutine_fn bdrv_co_drain(BlockDriverState *bs)   {   assert(qemu_in_coroutine()); +    assert(qemu_in_main_thread());   bd

Re: [PATCH v4 03/25] assertions for block global state API

2021-11-15 Thread Emanuele Giuseppe Esposito
@@ -5958,6 +6043,7 @@ const char *bdrv_get_parent_name(const BlockDriverState *bs)   /* TODO check what callers really want: bs->node_name or blk_name() */   const char *bdrv_get_device_name(const BlockDriverState *bs)   { +    assert(qemu_in_main_thread());   return bdrv_get_parent_name(bs

Re: [PATCH v4 03/25] assertions for block global state API

2021-11-12 Thread Hanna Reitz
On 25.10.21 12:17, Emanuele Giuseppe Esposito wrote: 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 Reviewed-by:

Re: [PATCH v4 03/25] assertions for block global state API

2021-11-11 Thread Hanna Reitz
On 25.10.21 12:17, Emanuele Giuseppe Esposito wrote: 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 Reviewed-by:

[PATCH v4 03/25] assertions for block global state API

2021-10-25 Thread Emanuele Giuseppe Esposito
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 Reviewed-by: Stefan Hajnoczi --- block.c| 136 +++