Patchwork [29/30] migration: Only go to the iterate stage if there is anything to send

login
register
mail settings
Submitter Juan Quintela
Date Oct. 18, 2012, 7:30 a.m.
Message ID <1350545426-23172-30-git-send-email-quintela@redhat.com>
Download mbox | patch
Permalink /patch/192210/
State New
Headers show

Comments

Juan Quintela - Oct. 18, 2012, 7:30 a.m.
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

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();