On 12/11/2021 14:51, Hanna Reitz wrote:
On 25.10.21 12:17, Emanuele Giuseppe Esposito wrote:
Signed-off-by: Emanuele Giuseppe Esposito <eespo...@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>
---
block.c | 17 +++++++++++++++++
block/backup.c | 1 +
block/block-backend.c | 3 +++
block/commit.c | 2 ++
block/dirty-bitmap.c | 1 +
block/io.c | 6 ++++++
block/mirror.c | 4 ++++
block/monitor/bitmap-qmp-cmds.c | 6 ++++++
block/stream.c | 2 ++
blockdev.c | 7 +++++++
10 files changed, 49 insertions(+)
diff --git a/block.c b/block.c
index 672f946065..41c5883c5c 100644
--- a/block.c
+++ b/block.c
[...]
@@ -7473,6 +7488,7 @@ static bool append_strong_runtime_options(QDict
*d, BlockDriverState *bs)
* would result in exactly bs->backing. */
bool bdrv_backing_overridden(BlockDriverState *bs)
{
+ assert(qemu_in_main_thread());
if (bs->backing) {
return strcmp(bs->auto_backing_file,
bs->backing->bs->filename);
This function is in block_int-common.h, though.
Can go as GS, since it is under BQL.
(Actually, it is only used in block.c, so if you want I can put it as
static). Otherwise, I will just move it to GS.
I agree with the rest.
Thank you,
Emanuele
[...]
diff --git a/block/io.c b/block/io.c
index c5d7f8495e..f271ab3684 100644
--- a/block/io.c
+++ b/block/io.c
[...]
@@ -3419,6 +3423,7 @@ int coroutine_fn
bdrv_co_copy_range_from(BdrvChild *src, int64_t src_offset,
{
trace_bdrv_co_copy_range_from(src, src_offset, dst, dst_offset,
bytes,
read_flags, write_flags);
+ assert(qemu_in_main_thread());
return bdrv_co_copy_range_internal(src, src_offset, dst,
dst_offset,
bytes, read_flags,
write_flags, true);
}
This is a block_int-io.h function.
@@ -3435,6 +3440,7 @@ int coroutine_fn bdrv_co_copy_range_to(BdrvChild
*src, int64_t src_offset,
{
trace_bdrv_co_copy_range_to(src, src_offset, dst, dst_offset,
bytes,
read_flags, write_flags);
+ assert(qemu_in_main_thread());
return bdrv_co_copy_range_internal(src, src_offset, dst,
dst_offset,
bytes, read_flags,
write_flags, false);
}
This, too.
Hanna