提交 c0b2ba46 编写于 作者: J Juan Quintela

migration: simplify state assignmente

Once there, make sure that if we already know that there is one error,
just call migration_fd_cleanup() with the ERROR state.
Signed-off-by: NJuan Quintela <quintela@redhat.com>
Reviewed-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 3a230256
......@@ -371,7 +371,6 @@ void migrate_fd_put_ready(void *opaque)
DPRINTF("iterate\n");
if (qemu_savevm_state_iterate(s->mon, s->file) == 1) {
int state;
int old_vm_running = runstate_is_running();
DPRINTF("done iterating\n");
......@@ -381,20 +380,18 @@ void migrate_fd_put_ready(void *opaque)
if (old_vm_running) {
vm_start();
}
state = MIG_STATE_ERROR;
} else {
state = MIG_STATE_COMPLETED;
s->state = MIG_STATE_ERROR;
}
if (migrate_fd_cleanup(s) < 0) {
if (old_vm_running) {
vm_start();
}
state = MIG_STATE_ERROR;
s->state = MIG_STATE_ERROR;
}
if (state == MIG_STATE_COMPLETED) {
if (s->state == MIG_STATE_ACTIVE) {
s->state = MIG_STATE_COMPLETED;
runstate_set(RUN_STATE_POSTMIGRATE);
}
s->state = state;
notifier_list_notify(&migration_state_notifiers, NULL);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册