From f5bbfba1ebe8c877ebfe846fc1e73e90da423884 Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Fri, 29 Jul 2011 15:04:45 -0300 Subject: 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 --- migration.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'migration.c') diff --git a/migration.c b/migration.c index 29f1a76..f2499cf 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); } -- cgit v1.1