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