aboutsummaryrefslogtreecommitdiff
path: root/block-migration.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2012-08-29 21:37:14 +0200
committerJuan Quintela <quintela@redhat.com>2012-10-17 18:34:59 +0200
commitceb2bd09a13ea71d06353bf826524df3cf584735 (patch)
tree2c3b6d0c913785c649e780fc1971ead32a24ae24 /block-migration.c
parent59feec424723c0cacf503670a42d76e7c47167c1 (diff)
downloadqemu-arm-ceb2bd09a13ea71d06353bf826524df3cf584735.tar.gz
block-migration: Switch meaning of return value
Make consistent the result of blk_mig_save_dirty_block() and mig_save_device_dirty() 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.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/block-migration.c b/block-migration.c
index f5ce386450..b47a063834 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -429,14 +429,18 @@ error:
return 0;
}
+/* return value:
+ * 0: too much data for max_downtime
+ * 1: few enough data for max_downtime
+*/
static int blk_mig_save_dirty_block(QEMUFile *f, int is_async)
{
BlkMigDevState *bmds;
- int ret = 0;
+ int ret = 1;
QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
- if (mig_save_device_dirty(f, bmds, is_async) == 0) {
- ret = 1;
+ ret = mig_save_device_dirty(f, bmds, is_async);
+ if (ret == 0) {
break;
}
}
@@ -596,7 +600,7 @@ static int block_save_iterate(QEMUFile *f, void *opaque)
block_mig_state.bulk_completed = 1;
}
} else {
- if (blk_mig_save_dirty_block(f, 1) == 0) {
+ if (blk_mig_save_dirty_block(f, 1) != 0) {
/* no more dirty blocks */
break;
}
@@ -633,7 +637,7 @@ static int block_save_complete(QEMUFile *f, void *opaque)
all async read completed */
assert(block_mig_state.submitted == 0);
- while (blk_mig_save_dirty_block(f, 0) != 0) {
+ while (blk_mig_save_dirty_block(f, 0) == 0) {
/* Do nothing */
}
blk_mig_cleanup();