aboutsummaryrefslogtreecommitdiff
path: root/migration.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2011-02-22 23:18:20 +0100
committerJuan Quintela <quintela@redhat.com>2011-10-20 13:23:53 +0200
commit67afff79111f0ce1ae20010c27a30b5ec61f362c (patch)
tree893cb14e7855891b2e5cb10f8245483df2a04ba7 /migration.c
parentd5934dde1cc47306800558a8c8619dc6a976c11c (diff)
migration: Refactor and simplify error checking in migrate_fd_put_ready
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'migration.c')
-rw-r--r--migration.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/migration.c b/migration.c
index 281fbaefd7..ee4ef4ba6f 100644
--- a/migration.c
+++ b/migration.c
@@ -372,23 +372,22 @@ static void migrate_fd_put_ready(void *opaque)
DPRINTF("done iterating\n");
vm_stop(RUN_STATE_FINISH_MIGRATE);
- if ((qemu_savevm_state_complete(s->mon, s->file)) < 0) {
- if (old_vm_running) {
- vm_start();
+ if (qemu_savevm_state_complete(s->mon, s->file) < 0) {
+ migrate_fd_error(s);
+ } else {
+ if (migrate_fd_cleanup(s) < 0) {
+ migrate_fd_error(s);
+ } else {
+ s->state = MIG_STATE_COMPLETED;
+ runstate_set(RUN_STATE_POSTMIGRATE);
+ notifier_list_notify(&migration_state_notifiers, NULL);
}
- s->state = MIG_STATE_ERROR;
}
- if (migrate_fd_cleanup(s) < 0) {
+ if (s->get_status(s) != MIG_STATE_COMPLETED) {
if (old_vm_running) {
vm_start();
}
- s->state = MIG_STATE_ERROR;
}
- if (s->state == MIG_STATE_ACTIVE) {
- s->state = MIG_STATE_COMPLETED;
- runstate_set(RUN_STATE_POSTMIGRATE);
- }
- notifier_list_notify(&migration_state_notifiers, NULL);
}
}