diff options
author | Juan Quintela <quintela@redhat.com> | 2011-10-05 01:14:46 +0200 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2011-10-20 13:23:52 +0200 |
commit | 42802d47dd09c6e70763676bb2ba59136427ec6a (patch) | |
tree | 93f90e6d8f51d9e586a0914fe34e3a1a14f7cd52 /block-migration.c | |
parent | 3961b4dd0e72ae70e612be1097176d8910fc3f5e (diff) | |
download | qemu-42802d47dd09c6e70763676bb2ba59136427ec6a.tar.gz qemu-42802d47dd09c6e70763676bb2ba59136427ec6a.tar.bz2 qemu-42802d47dd09c6e70763676bb2ba59136427ec6a.zip |
migration: use qemu_file_get_error() return value when possible
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'block-migration.c')
-rw-r--r-- | block-migration.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/block-migration.c b/block-migration.c index 56907a664c..b8d19a1151 100644 --- a/block-migration.c +++ b/block-migration.c @@ -647,6 +647,7 @@ static int block_load(QEMUFile *f, void *opaque, int version_id) uint8_t *buf; int64_t total_sectors = 0; int nr_sectors; + int ret; do { addr = qemu_get_be64(f); @@ -655,7 +656,6 @@ 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); @@ -705,8 +705,9 @@ static int block_load(QEMUFile *f, void *opaque, int version_id) fprintf(stderr, "Unknown flags\n"); return -EINVAL; } - if (qemu_file_get_error(f)) { - return -EIO; + ret = qemu_file_get_error(f); + if (ret != 0) { + return ret; } } while (!(flags & BLK_MIG_FLAG_EOS)); |