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:
Luiz Capitulino 2011-07-29 15:04:45 -03:00
parent 1dfb4dd993
commit f5bbfba1eb
4 changed files with 35 additions and 2 deletions

1
cpus.c
View file

@ -124,6 +124,7 @@ static void do_vm_stop(RunState state)
cpu_disable_ticks();
vm_running = 0;
pause_all_vcpus();
runstate_set(state);
vm_state_notify(0, state);
qemu_aio_flush();
bdrv_flush_all();