diff mbox

[4/7] savevm: avoid qemu_savevm_state_iterate() to return 1 when qemu file has error.

Message ID d0d82edb7a7710748a3e36cf5aa5cb2d5e318835.1316524908.git.quintela@redhat.com
State New
Headers show

Commit Message

Juan Quintela Sept. 20, 2011, 1:24 p.m. UTC
From: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>

When qemu on the receiver gets killed during live migration, if debug
is turned on, migrate_fd_put_ready() says,

migration: done iterating

and proceeds.  The reason was qemu_savevm_state_iterate() returning 1
even when qemu file has error.  This patch checks
qemu_file_has_error() before returning 1/0, and avoids
migrate_fd_put_ready() to proceed in case of error.

Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 savevm.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/savevm.c b/savevm.c
index a793137..af0d0e7 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1531,14 +1531,15 @@  int qemu_savevm_state_iterate(Monitor *mon, QEMUFile *f)
         }
     }

-    if (ret)
-        return 1;
-
     if (qemu_file_has_error(f)) {
         qemu_savevm_state_cancel(mon, f);
         return -EIO;
     }

+    if (ret) {
+        return 1;
+    }
+
     return 0;
 }