diff options
-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; } } |