mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06: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:
parent
1dfb4dd993
commit
f5bbfba1eb
4 changed files with 35 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue