diff mbox

[09/17] Propagate errors on failed migration.

Message ID 1242574999-20887-10-git-send-email-aliguori@us.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Anthony Liguori May 17, 2009, 3:43 p.m. UTC
From: Glauber Costa <glommer@redhat.com>

We're currently ignoring any errors if dirty logging fails.
Set error on migration file if we're unable to put dirty logging
on.

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
diff mbox

Patch

diff --git a/vl.c b/vl.c
index 5d02e10..dd2ae4c 100644
--- a/vl.c
+++ b/vl.c
@@ -3195,8 +3195,15 @@  static int ram_save_block(QEMUFile *f)
     int found = 0;
 
     while (addr < phys_ram_size) {
-        if (kvm_enabled() && current_addr == 0)
-            kvm_update_dirty_pages_log(); /* FIXME: propagate errors */
+        if (kvm_enabled() && current_addr == 0) {
+            int r;
+            r = kvm_update_dirty_pages_log();
+            if (r) {
+                fprintf(stderr, "%s: update dirty pages log failed %d\n", __FUNCTION__, r);
+                qemu_file_set_error(f);
+                return 0;
+            }
+        }
         if (cpu_physical_memory_get_dirty(current_addr, MIGRATION_DIRTY_FLAG)) {
             uint8_t ch;