qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 07/25] assertions for block_int global state API


From: Emanuele Giuseppe Esposito
Subject: Re: [PATCH v4 07/25] assertions for block_int global state API
Date: Tue, 16 Nov 2021 16:43:35 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0



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 <eesposit@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]