summaryrefslogtreecommitdiff
path: root/block-migration.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2012-08-29 20:17:13 +0200
committerJuan Quintela <quintela@redhat.com>2012-10-17 18:34:59 +0200
commit59feec424723c0cacf503670a42d76e7c47167c1 (patch)
treefc5b5e255650978f39f14c725c9b8fc8e6884fe5 /block-migration.c
parent81fdf640e4b479df75fcedf03fb300018f054bfa (diff)
block-migration: make flush_blks() return errors
This means we don't need to pass through qemu_file to get the errors. Adjust all callers. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'block-migration.c')
-rw-r--r--block-migration.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/block-migration.c b/block-migration.c
index ed933017f9..f5ce386450 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -444,9 +444,10 @@ static int blk_mig_save_dirty_block(QEMUFile *f, int is_async)
return ret;
}
-static void flush_blks(QEMUFile* f)
+static int flush_blks(QEMUFile *f)
{
BlkMigBlock *blk;
+ int ret = 0;
DPRINTF("%s Enter submitted %d read_done %d transferred %d\n",
__FUNCTION__, block_mig_state.submitted, block_mig_state.read_done,
@@ -457,7 +458,7 @@ static void flush_blks(QEMUFile* f)
break;
}
if (blk->ret < 0) {
- qemu_file_set_error(f, blk->ret);
+ ret = blk->ret;
break;
}
blk_send(f, blk);
@@ -474,6 +475,7 @@ static void flush_blks(QEMUFile* f)
DPRINTF("%s Exit submitted %d read_done %d transferred %d\n", __FUNCTION__,
block_mig_state.submitted, block_mig_state.read_done,
block_mig_state.transferred);
+ return ret;
}
static int64_t get_remaining_dirty(void)
@@ -555,9 +557,7 @@ static int block_save_setup(QEMUFile *f, void *opaque)
/* start track dirty blocks */
set_dirty_tracking(1);
- flush_blks(f);
-
- ret = qemu_file_get_error(f);
+ ret = flush_blks(f);
if (ret) {
blk_mig_cleanup();
return ret;
@@ -577,9 +577,7 @@ static int block_save_iterate(QEMUFile *f, void *opaque)
DPRINTF("Enter save live iterate submitted %d transferred %d\n",
block_mig_state.submitted, block_mig_state.transferred);
- flush_blks(f);
-
- ret = qemu_file_get_error(f);
+ ret = flush_blks(f);
if (ret) {
blk_mig_cleanup();
return ret;
@@ -605,9 +603,7 @@ static int block_save_iterate(QEMUFile *f, void *opaque)
}
}
- flush_blks(f);
-
- ret = qemu_file_get_error(f);
+ ret = flush_blks(f);
if (ret) {
blk_mig_cleanup();
return ret;
@@ -625,9 +621,7 @@ static int block_save_complete(QEMUFile *f, void *opaque)
DPRINTF("Enter save live complete submitted %d transferred %d\n",
block_mig_state.submitted, block_mig_state.transferred);
- flush_blks(f);
-
- ret = qemu_file_get_error(f);
+ ret = flush_blks(f);
if (ret) {
blk_mig_cleanup();
return ret;