diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-05 19:30:33 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-05 19:30:33 +0000 |
commit | b161d123e77ffbd6ee96edcfb8a02541c5e9439b (patch) | |
tree | 5c4c4d2840e63ebaa40d1f73d6f6c1a327f34d81 /migration.c | |
parent | 3dd1f8ef0fb7f52414acecf15656fca6ced626fd (diff) |
propagate error on failed completion (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
Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6997 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'migration.c')
-rw-r--r-- | migration.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/migration.c b/migration.c index b3904b2d43..859d945434 100644 --- a/migration.c +++ b/migration.c @@ -220,13 +220,19 @@ void migrate_fd_put_ready(void *opaque) dprintf("iterate\n"); if (qemu_savevm_state_iterate(s->file) == 1) { + int state; dprintf("done iterating\n"); vm_stop(0); bdrv_flush_all(); - qemu_savevm_state_complete(s->file); - s->state = MIG_STATE_COMPLETED; + if ((qemu_savevm_state_complete(s->file)) < 0) { + vm_start(); + state = MIG_STATE_ERROR; + } else { + state = MIG_STATE_COMPLETED; + } migrate_fd_cleanup(s); + s->state = state; } } |