Skip to contentSkip to conversation

propagate errors on failed migration.

PATCH Applied Glauber Costa 2 participants 2 messages Apr 6, 2009 – Apr 11, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 propagate errors on failed migration.

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

---
 qemu/vl.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
qemu/vl.c +9 -2
index 8aa9ebc..4da73b8 100644
@@ -3226,8 +3226,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;
 
Signature · 1 line
1.5.6.6
Applied
#1 lore raw
Quoted 4 lines · Glauber Costa

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

Applied, thanks.

Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.