aboutsummaryrefslogtreecommitdiff
path: root/migration.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-07-29 15:04:45 -0300
committerLuiz Capitulino <lcapitulino@redhat.com>2011-09-15 16:39:32 -0300
commitf5bbfba1ebe8c877ebfe846fc1e73e90da423884 (patch)
treecd395df17a18a35cb4e5a9a8f0d6e378027a7794 /migration.c
parent1dfb4dd993f7122353fb2894f09dfcba894cd7d5 (diff)
RunState: Add additional states
Currently, only vm_start() and vm_stop() change the VM state. That's, the state is only changed when starting or stopping the VM. This commit adds the runstate_set() function, which makes it possible to also do state transitions when the VM is stopped or running. Additional states are also added and the current state is stored. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'migration.c')
-rw-r--r--migration.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/migration.c b/migration.c
index 29f1a76df1..f2499cfdd4 100644
--- a/migration.c
+++ b/migration.c
@@ -72,8 +72,11 @@ void process_incoming_migration(QEMUFile *f)
incoming_expected = false;
- if (autostart)
+ if (autostart) {
vm_start();
+ } else {
+ runstate_set(RSTATE_PRE_LAUNCH);
+ }
}
int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data)
@@ -390,6 +393,9 @@ void migrate_fd_put_ready(void *opaque)
}
state = MIG_STATE_ERROR;
}
+ if (state == MIG_STATE_COMPLETED) {
+ runstate_set(RSTATE_POST_MIGRATE);
+ }
s->state = state;
notifier_list_notify(&migration_state_notifiers, NULL);
}