[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/7] block migration: propagate return value when bd
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 2/7] block migration: propagate return value when bdrv_write() returns < 0 |
Date: |
Mon, 26 Jul 2010 16:01:12 +0200 |
From: Yoshiaki Tamura <address@hidden>
Currently block_load() doesn't check return value of bdrv_write(), and
even the destination weren't prepared to execute block migration, it
proceeds and guest boots on the target. This patch fix this issue.
Signed-off-by: Yoshiaki Tamura <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block-migration.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/block-migration.c b/block-migration.c
index a77106e..8eda307 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -586,6 +586,7 @@ static int block_load(QEMUFile *f, void *opaque, int
version_id)
addr >>= BDRV_SECTOR_BITS;
if (flags & BLK_MIG_FLAG_DEVICE_BLOCK) {
+ int ret;
/* get device name */
len = qemu_get_byte(f);
qemu_get_buffer(f, (uint8_t *)device_name, len);
@@ -601,9 +602,12 @@ static int block_load(QEMUFile *f, void *opaque, int
version_id)
buf = qemu_malloc(BLOCK_SIZE);
qemu_get_buffer(f, buf, BLOCK_SIZE);
- bdrv_write(bs, addr, buf, BDRV_SECTORS_PER_DIRTY_CHUNK);
+ ret = bdrv_write(bs, addr, buf, BDRV_SECTORS_PER_DIRTY_CHUNK);
qemu_free(buf);
+ if (ret < 0) {
+ return ret;
+ }
} else if (flags & BLK_MIG_FLAG_PROGRESS) {
if (!banner_printed) {
printf("Receiving block device images\n");
--
1.7.1.1
- [Qemu-devel] [PULL 0/7] Block patches, Kevin Wolf, 2010/07/26
- [Qemu-devel] [PATCH 1/7] ide/atapi: add support for GET EVENT STATUS NOTIFICATION, Kevin Wolf, 2010/07/26
- [Qemu-devel] [PATCH 2/7] block migration: propagate return value when bdrv_write() returns < 0,
Kevin Wolf <=
- [Qemu-devel] [PATCH 3/7] virtio-blk: Create exit function to unregister savevm, Kevin Wolf, 2010/07/26
- [Qemu-devel] [PATCH 7/7] Fix -snapshot deleting images on disk change, Kevin Wolf, 2010/07/26
- [Qemu-devel] [PATCH 5/7] block: default to 0 minimal / optiomal I/O size, Kevin Wolf, 2010/07/26
- [Qemu-devel] [PATCH 4/7] move 'unsafe' to end of caching modes in help, Kevin Wolf, 2010/07/26
- [Qemu-devel] [PATCH 6/7] block: Use error codes from lower levels for error message, Kevin Wolf, 2010/07/26