Skip to content

Commit

Permalink
block-migration: fix block_save_iterate() return value
Browse files Browse the repository at this point in the history
The .save_live_iterate() function returns 0 to continue iterating or 1
to stop iterating.

Since 16310a3 it only ever returns 0,
leading to an infinite loop.

Return 1 if we have finished sending dirty blocks.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1360534366-26723-4-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
  • Loading branch information
stefanhaRH authored and Anthony Liguori committed Feb 11, 2013
1 parent 9ee0cb2 commit 2c5a7f2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion block-migration.c
Expand Up @@ -582,7 +582,12 @@ static int block_save_iterate(QEMUFile *f, void *opaque)

qemu_put_be64(f, BLK_MIG_FLAG_EOS);

return 0;
/* Complete when bulk transfer is done and all dirty blocks have been
* transferred.
*/
return block_mig_state.bulk_completed &&
block_mig_state.submitted == 0 &&
block_mig_state.read_done == 0;
}

static int block_save_complete(QEMUFile *f, void *opaque)
Expand Down

0 comments on commit 2c5a7f2

Please sign in to comment.