[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 04/12] block: Keep subtree drained in drop_interm
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v2 04/12] block: Keep subtree drained in drop_intermediate |
Date: |
Wed, 3 Jul 2019 19:28:05 +0200 |
bdrv_drop_intermediate() calls BdrvChildRole.update_filename(). That
may poll, thus changing the graph, which potentially breaks the
QLIST_FOREACH_SAFE() loop.
Just keep the whole subtree drained. This is probably the right thing
to do anyway (dropping nodes while the subtree is not drained seems
wrong).
Signed-off-by: Max Reitz <address@hidden>
---
block.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/block.c b/block.c
index a06f07347f..96b3dc7d53 100644
--- a/block.c
+++ b/block.c
@@ -4493,6 +4493,7 @@ int bdrv_drop_intermediate(BlockDriverState *top,
BlockDriverState *base,
int ret = -EIO;
bdrv_ref(top);
+ bdrv_subtree_drained_begin(top);
if (!top->drv || !base->drv) {
goto exit;
@@ -4564,6 +4565,7 @@ int bdrv_drop_intermediate(BlockDriverState *top,
BlockDriverState *base,
ret = 0;
exit:
+ bdrv_subtree_drained_end(top);
bdrv_unref(top);
return ret;
}
--
2.21.0
- [Qemu-devel] [PATCH v2 00/12] block: Fixes for concurrent block jobs, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 01/12] block: Add BDS.never_freeze, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 04/12] block: Keep subtree drained in drop_intermediate,
Max Reitz <=
- [Qemu-devel] [PATCH v2 11/12] iotests: Add read-only test case to 030, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 02/12] block/stream: Fix error path, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 05/12] block: Reduce (un)drains when replacing a child, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 09/12] iotests: Add @use_log to VM.run_job(), Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 12/12] iotests: Add test for concurrent stream/commit, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 07/12] iotests: Fix throttling in 030, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 03/12] block/stream: Swap backing file change order, Max Reitz, 2019/07/03
- [Qemu-devel] [PATCH v2 08/12] iotests: Compare error messages in 030, Max Reitz, 2019/07/03