mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
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>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user