migration: Only go to the iterate stage if there is anything to send
authorJuan Quintela <quintela@redhat.com>
Wed, 17 Oct 2012 19:06:31 +0000 (21:06 +0200)
committerJuan Quintela <quintela@redhat.com>
Thu, 17 Jan 2013 12:54:52 +0000 (13:54 +0100)
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
migration.c

index 6d3aeeda5101ca9d93257590bef3a17cba9e855d..fe1a103abe906134a7fe5f447f257789984339fe 100644 (file)
@@ -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();