[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 33/37] mirror: block all operations on the target ima
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 33/37] mirror: block all operations on the target image during the job |
Date: |
Thu, 5 Nov 2015 19:18:01 +0100 |
From: Alberto Garcia <address@hidden>
There's nothing preventing the target image from being used by other
operations during the 'drive-mirror' job, so we should block them all
until the job is done.
Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
block/mirror.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block/mirror.c b/block/mirror.c
index b1252a1..60f1cb5 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -384,6 +384,7 @@ static void mirror_exit(BlockJob *job, void *opaque)
aio_context_release(replace_aio_context);
}
g_free(s->replaces);
+ bdrv_op_unblock_all(s->target, s->common.blocker);
bdrv_unref(s->target);
block_job_completed(&s->common, data->ret);
g_free(data);
@@ -744,6 +745,9 @@ static void mirror_start_job(BlockDriverState *bs,
BlockDriverState *target,
block_job_release(bs);
return;
}
+
+ bdrv_op_block_all(s->target, s->common.blocker);
+
bdrv_set_enable_write_cache(s->target, true);
if (s->target->blk) {
blk_set_on_error(s->target->blk, on_target_error, on_target_error);
--
1.8.3.1
- [Qemu-devel] [PULL 24/37] qcow2: avoid misaligned 64bit bswap, (continued)
- [Qemu-devel] [PULL 24/37] qcow2: avoid misaligned 64bit bswap, Kevin Wolf, 2015/11/05
- [Qemu-devel] [PULL 27/37] throttle: Use bs->throttle_state instead of bs->io_limits_enabled, Kevin Wolf, 2015/11/05
- [Qemu-devel] [PULL 20/37] block: add a 'blockdev-snapshot' QMP command, Kevin Wolf, 2015/11/05
- [Qemu-devel] [PULL 16/37] iotests: Add test for change-related QMP commands, Kevin Wolf, 2015/11/05
- [Qemu-devel] [PULL 28/37] block: Disallow snapshots if the overlay doesn't support backing files, Kevin Wolf, 2015/11/05
- [Qemu-devel] [PULL 29/37] block: Remove inner quotation marks in iotest 085, Kevin Wolf, 2015/11/05
- [Qemu-devel] [PULL 34/37] block: Add blk_get_refcnt(), Kevin Wolf, 2015/11/05
- [Qemu-devel] [PULL 31/37] qemu-iotests: fix cleanup of background processes, Kevin Wolf, 2015/11/05
- [Qemu-devel] [PULL 30/37] block: test 'blockdev-snapshot' using a file BDS as the overlay, Kevin Wolf, 2015/11/05
- [Qemu-devel] [PULL 32/37] qemu-iotests: fix -valgrind option for check, Kevin Wolf, 2015/11/05
- [Qemu-devel] [PULL 33/37] mirror: block all operations on the target image during the job,
Kevin Wolf <=
- [Qemu-devel] [PULL 35/37] block: Add 'x-blockdev-del' QMP command, Kevin Wolf, 2015/11/05
- [Qemu-devel] [PULL 36/37] iotests: Add tests for the x-blockdev-del command, Kevin Wolf, 2015/11/05
- [Qemu-devel] [PULL 37/37] qcow2: Fix qcow2_get_cluster_offset() for zero clusters, Kevin Wolf, 2015/11/05
- Re: [Qemu-devel] [PULL 00/37] Block layer patches, Peter Maydell, 2015/11/05