From patchwork Thu Oct 18 07:30:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [29/30] migration: Only go to the iterate stage if there is anything to send Date: Wed, 17 Oct 2012 21:30:25 -0000 From: Juan Quintela X-Patchwork-Id: 192210 Message-Id: <1350545426-23172-30-git-send-email-quintela@redhat.com> To: qemu-devel@nongnu.org Cc: Orit Wasserman Signed-off-by: Orit Wasserman Signed-off-by: Juan Quintela --- migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration.c b/migration.c index 3856a99..554d79a 100644 --- a/migration.c +++ b/migration.c @@ -684,7 +684,7 @@ static void *buffered_file_thread(void *opaque) DPRINTF("iterate\n"); pending_size = qemu_savevm_state_pending(m->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(m->file); if (ret < 0) { qemu_mutex_unlock_iothread();