From: Juan Quintela Date: Wed, 17 Oct 2012 19:06:31 +0000 (+0200) Subject: migration: Only go to the iterate stage if there is anything to send X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b22ff1fbed9d7f1f677804cbaa9ee03ca17d0013;p=qemu.git migration: Only go to the iterate stage if there is anything to send Signed-off-by: Orit Wasserman Signed-off-by: Juan Quintela Reviewed-by: Reviewed-by: Eric Blake Reviewed-by: Paolo Bonzini --- diff --git a/migration.c b/migration.c index 6d3aeeda51..fe1a103abe 100644 --- a/migration.c +++ b/migration.c @@ -698,7 +698,7 @@ static void *buffered_file_thread(void *opaque) DPRINTF("iterate\n"); pending_size = qemu_savevm_state_pending(s->file, max_size); DPRINTF("pending size %lu max %lu\n", pending_size, max_size); - if (pending_size >= max_size) { + if (pending_size && pending_size >= max_size) { ret = qemu_savevm_state_iterate(s->file); if (ret < 0) { qemu_mutex_unlock_iothread();