Skip to contentSkip to conversation

propagate error on failed completion

PATCH In review Glauber Costa 2 participants 3 messages Mar 31, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 propagate error on failed completion

migrate_fd_put_ready() calls qemu_savevm_state_complete(), but the later can fail.

If it happens, re-start the vm and propagate the error up

Based on a patch by Yaniv Kamay

---
 migration.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
migration.c +5 -1
index b3904b2..d77ebbd 100644
@@ -224,7 +224,11 @@ void migrate_fd_put_ready(void *opaque)
         vm_stop(0);
 
         bdrv_flush_all();
-        qemu_savevm_state_complete(s->file);
+        if ((qemu_savevm_state_complete(s->file)) < 0) {
+            vm_start();
+            s->state = MIG_STATE_ERROR;
+            return;
+        }
         s->state = MIG_STATE_COMPLETED;
         migrate_fd_cleanup(s);
     }
Signature · 1 line
1.5.6.6
#1 lore raw
Quoted 22 lines · Glauber Costa

migrate_fd_put_ready() calls qemu_savevm_state_complete(), but the later can fail.

If it happens, re-start the vm and propagate the error up

Based on a patch by Yaniv Kamay

---
 migration.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
migration.c +0 -0
index b3904b2..d77ebbd 100644
@@ -224,7 +224,11 @@ void migrate_fd_put_ready(void *opaque)
         vm_stop(0);
 

migration.c void migrate_fd_put_ready(void *opaque) · line 234

Quoted 10 lines
migration.c +5 -1
         bdrv_flush_all();
-        qemu_savevm_state_complete(s->file);
+        if ((qemu_savevm_state_complete(s->file)) < 0) {
+            vm_start();
+            s->state = MIG_STATE_ERROR;
+            return;
+        }
         s->state = MIG_STATE_COMPLETED;
         migrate_fd_cleanup(s);
     }

We need to call migrate_fd_cleanup() in case of error.

Yaniv

#2 lore raw
Quoted 25 lines · Yaniv Kamay
Quoted 24 lines · Glauber Costa

migrate_fd_put_ready() calls qemu_savevm_state_complete(), but the later can fail.

If it happens, re-start the vm and propagate the error up

Based on a patch by Yaniv Kamay

---
 migration.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
migration.c +2 -1
index b3904b2..d77ebbd 100644
@@ -224,7 +224,11 @@ void migrate_fd_put_ready(void *opaque)
         vm_stop(0);
          bdrv_flush_all();
-        qemu_savevm_state_complete(s->file);
+        if ((qemu_savevm_state_complete(s->file)) < 0) {
+            vm_start();
Quoted 8 lines

migration.c void migrate_fd_put_ready(void *opaque)

Quoted 7 lines
migration.c +3 -0
+            s->state = MIG_STATE_ERROR;
+            return;
+        }
         s->state = MIG_STATE_COMPLETED;
         migrate_fd_cleanup(s);
     }
 

We need to call migrate_fd_cleanup() in case of error.

thanks for the spot. I will update this patch.

Quoted 3 lines

Yaniv