[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v10 07/16] block: Block all intermediate nodes in co
From: |
Alberto Garcia |
Subject: |
[Qemu-block] [PATCH v10 07/16] block: Block all intermediate nodes in commit_active_start() |
Date: |
Thu, 6 Oct 2016 16:02:50 +0300 |
When block-commit is launched without the top parameter, it uses
internally a mirror block job. In that case all intermediate nodes
between the active and base nodes must be blocked as well.
Signed-off-by: Alberto Garcia <address@hidden>
---
block/mirror.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/block/mirror.c b/block/mirror.c
index 9b5159f..a5b71b7 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -965,6 +965,14 @@ static void mirror_start_job(const char *job_id,
BlockDriverState *bs,
}
block_job_add_bdrv(&s->common, target);
+ /* In commit_active_start() all intermediate nodes disappear, so
+ * any jobs in them must be blocked */
+ if (bdrv_chain_contains(bs, target)) {
+ BlockDriverState *iter;
+ for (iter = backing_bs(bs); iter != target; iter = backing_bs(iter)) {
+ block_job_add_bdrv(&s->common, iter);
+ }
+ }
s->common.co = qemu_coroutine_create(mirror_run, s);
trace_mirror_start(bs, s, s->common.co, opaque);
--
2.9.3
- Re: [Qemu-block] [PATCH v10 10/16] docs: Document how to stream to an intermediate layer, (continued)
[Qemu-block] [PATCH v10 07/16] block: Block all intermediate nodes in commit_active_start(),
Alberto Garcia <=
[Qemu-block] [PATCH v10 15/16] qemu-iotests: Add iotests.supports_quorum(), Alberto Garcia, 2016/10/06
[Qemu-block] [PATCH v10 12/16] qemu-iotests: Test block-stream operations in parallel, Alberto Garcia, 2016/10/06
[Qemu-block] [PATCH v10 11/16] qemu-iotests: Test streaming to an intermediate layer, Alberto Garcia, 2016/10/06