[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [RFC PATCH v2 03/12] block: Freeze the backing chain for th
From: |
Alberto Garcia |
Subject: |
[Qemu-block] [RFC PATCH v2 03/12] block: Freeze the backing chain for the duration of the mirror job |
Date: |
Fri, 30 Nov 2018 17:17:41 +0200 |
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 f746618224..944ece83ed 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -631,6 +631,10 @@ static int mirror_exit_common(Job *job)
}
s->prepared = true;
+ if (bdrv_chain_contains(src, target_bs)) {
+ bdrv_unfreeze_backing_chain(mirror_top_bs, target_bs);
+ }
+
bdrv_release_dirty_bitmap(src, s->dirty_bitmap);
/* Make sure that the source BDS doesn't go away during bdrv_replace_node,
@@ -1641,6 +1645,10 @@ static void mirror_start_job(const char *job_id,
BlockDriverState *bs,
goto fail;
}
}
+
+ if (bdrv_freeze_backing_chain(mirror_top_bs, target, errp) < 0) {
+ goto fail;
+ }
}
QTAILQ_INIT(&s->ops_in_flight);
--
2.11.0
- [Qemu-block] [RFC PATCH v2 00/12] Add a 'x-blockdev-reopen' QMP command, Alberto Garcia, 2018/11/30
- [Qemu-block] [RFC PATCH v2 02/12] block: Freeze the backing chain for the duration of the commit job, Alberto Garcia, 2018/11/30
- [Qemu-block] [RFC PATCH v2 07/12] block: Allow omitting the 'backing' option in certain cases, Alberto Garcia, 2018/11/30
- [Qemu-block] [RFC PATCH v2 05/12] block: Add 'keep_old_opts' parameter to bdrv_reopen_queue(), Alberto Garcia, 2018/11/30
- [Qemu-block] [RFC PATCH v2 08/12] block: Allow changing the backing file on reopen, Alberto Garcia, 2018/11/30
- [Qemu-block] [RFC PATCH v2 01/12] block: Allow freezing BdrvChild links, Alberto Garcia, 2018/11/30
- [Qemu-block] [RFC PATCH v2 03/12] block: Freeze the backing chain for the duration of the mirror job,
Alberto Garcia <=
- [Qemu-block] [RFC PATCH v2 06/12] block: Handle child references in bdrv_reopen_queue(), Alberto Garcia, 2018/11/30
- [Qemu-block] [RFC PATCH v2 04/12] block: Freeze the backing chain for the duration of the stream job, Alberto Garcia, 2018/11/30
- [Qemu-block] [RFC PATCH v2 11/12] block: Add an 'x-blockdev-reopen' QMP command, Alberto Garcia, 2018/11/30
- [Qemu-block] [RFC PATCH v2 09/12] block: Add 'runtime_opts' and 'mutable_opts' fields to BlockDriver, Alberto Garcia, 2018/11/30
- [Qemu-block] [RFC PATCH v2 10/12] block: Add bdrv_reset_options_allowed(), Alberto Garcia, 2018/11/30
- [Qemu-block] [RFC PATCH v2 12/12] qemu-iotests: Test the x-blockdev-reopen QMP command, Alberto Garcia, 2018/11/30