qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH v2 08/25] block: introduce assert_bdrv_graph_writable


From: Emanuele Giuseppe Esposito
Subject: Re: [RFC PATCH v2 08/25] block: introduce assert_bdrv_graph_writable
Date: Thu, 7 Oct 2021 15:47:42 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1



On 07/10/2021 14:02, Paolo Bonzini wrote:
--- a/block/io.c
+++ b/block/io.c
@@ -739,6 +739,11 @@ void bdrv_drain_all(void)
      bdrv_drain_all_end();
  }
+void assert_bdrv_graph_writable(BlockDriverState *bs)
+{
+    g_assert(qatomic_read(&bs->quiesce_counter) > 0 || qemu_in_main_thread());
+}

Hmm, wait - I think this should be an "&&", not an OR?


You are right, && makes more sense. But as you said, using an AND will make the assertion fail in multiple places, because the necessary drains are missing. So I am going to remove the check for drains and leave it as todo. I will handle this case in another patch.

Thank you,
Emanuele




reply via email to

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