[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 07/16] block: Keep subtree drained in drop_intermedia
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 07/16] block: Keep subtree drained in drop_intermediate |
Date: |
Fri, 16 Aug 2019 11:34:30 +0200 |
From: Max Reitz <address@hidden>
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>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/block.c b/block.c
index 6db8ecd62b..df3407934b 100644
--- a/block.c
+++ b/block.c
@@ -4491,6 +4491,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;
@@ -4562,6 +4563,7 @@ int bdrv_drop_intermediate(BlockDriverState *top,
BlockDriverState *base,
ret = 0;
exit:
+ bdrv_subtree_drained_end(top);
bdrv_unref(top);
return ret;
}
--
2.20.1
- [Qemu-block] [PULL 00/16] Block layer patches, Kevin Wolf, 2019/08/16
- [Qemu-block] [PULL 02/16] iotests/118: Create test classes dynamically, Kevin Wolf, 2019/08/16
- [Qemu-block] [PULL 01/16] iotests/118: Test media change for scsi-cd, Kevin Wolf, 2019/08/16
- [Qemu-block] [PULL 03/16] iotests/118: Add -blockdev based tests, Kevin Wolf, 2019/08/16
- [Qemu-block] [PULL 04/16] iotests: Move migration helpers to iotests.py, Kevin Wolf, 2019/08/16
- [Qemu-block] [PULL 06/16] block: Simplify bdrv_filter_default_perms(), Kevin Wolf, 2019/08/16
- [Qemu-block] [PULL 07/16] block: Keep subtree drained in drop_intermediate,
Kevin Wolf <=
- [Qemu-block] [PULL 05/16] iotests: Test migration with all kinds of filter nodes, Kevin Wolf, 2019/08/16
- [Qemu-block] [PULL 08/16] block: Reduce (un)drains when replacing a child, Kevin Wolf, 2019/08/16
- [Qemu-block] [PULL 09/16] tests: Test polling in bdrv_drop_intermediate(), Kevin Wolf, 2019/08/16
- [Qemu-block] [PULL 10/16] tests: Test mid-drain bdrv_replace_child_noperm(), Kevin Wolf, 2019/08/16
- [Qemu-block] [PULL 11/16] iotests: Add test for concurrent stream/commit, Kevin Wolf, 2019/08/16
- [Qemu-block] [PULL 12/16] block: Remove blk_pread_unthrottled(), Kevin Wolf, 2019/08/16
- [Qemu-block] [PULL 13/16] mirror: Keep mirror_top_bs drained after dropping permissions, Kevin Wolf, 2019/08/16
- [Qemu-block] [PULL 15/16] qemu-img convert: Deprecate using -n and -o together, Kevin Wolf, 2019/08/16
- [Qemu-block] [PULL 14/16] block-backend: Queue requests while drained, Kevin Wolf, 2019/08/16
- [Qemu-block] [PULL 16/16] file-posix: Handle undetectable alignment, Kevin Wolf, 2019/08/16