[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 13/34] block migration: Activate image on destination
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 13/34] block migration: Activate image on destination before writing to it |
Date: |
Mon, 22 Feb 2016 17:32:31 +0100 |
When using 'migrate -b', we must make sure to take ownership of the
image before writing to it. Otherwise metadata would be thrown away on
migration completion; this was caught by the assertions introduced in
commit 09e0c771.
Reported-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
migration/block.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/migration/block.c b/migration/block.c
index a444058..3a8330a 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -786,6 +786,7 @@ static int block_load(QEMUFile *f, void *opaque, int
version_id)
int64_t addr;
BlockDriverState *bs, *bs_prev = NULL;
BlockBackend *blk;
+ Error *local_err = NULL;
uint8_t *buf;
int64_t total_sectors = 0;
int nr_sectors;
@@ -824,6 +825,12 @@ static int block_load(QEMUFile *f, void *opaque, int
version_id)
device_name);
return -EINVAL;
}
+
+ bdrv_invalidate_cache(bs, &local_err);
+ if (local_err) {
+ error_report_err(local_err);
+ return -EINVAL;
+ }
}
if (total_sectors - addr < BDRV_SECTORS_PER_DIRTY_CHUNK) {
--
1.8.3.1
- [Qemu-block] [PULL 02/34] quorum: fix segfault when read fails in fifo mode, (continued)
- [Qemu-block] [PULL 02/34] quorum: fix segfault when read fails in fifo mode, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 03/34] spec: add qcow2 bitmaps extension specification, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 01/34] qemu-img: initialize MapEntry object, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 05/34] qemu-io: add support for --object command line arg, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 07/34] qemu-io: allow specifying image as a set of options args, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 08/34] qemu-nbd: allow specifying image as a set of options args, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 04/34] block: Fix -incoming with snapshot=on, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 06/34] qemu-img: add support for --object command line arg, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 12/34] qemu-io: use no_argument/required_argument constants, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 10/34] qemu-nbd: don't overlap long option values with short options, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 13/34] block migration: Activate image on destination before writing to it,
Kevin Wolf <=
- [Qemu-block] [PULL 14/34] throttle: Make throttle_compute_timer() static, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 09/34] qemu-img: allow specifying image as a set of options args, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 11/34] qemu-nbd: use no_argument/required_argument constants, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 15/34] throttle: Make throttle_conflicting() set errp, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 18/34] throttle: Set always an average value when setting a maximum value, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 17/34] throttle: Make throttle_is_valid() set errp, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 22/34] throttle: Add command-line settings to define the burst periods, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 24/34] qapi: Add burst length fields to BlockDeviceInfo, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 16/34] throttle: Make throttle_max_is_missing_limit() set errp, Kevin Wolf, 2016/02/22
- [Qemu-block] [PULL 30/34] MAINTAINERS: Add myself as maintainer of the throttling code, Kevin Wolf, 2016/02/22