[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/8] RunState: Add additional states
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [PATCH 3/8] RunState: Add additional states |
Date: |
Thu, 01 Sep 2011 20:30:57 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
On 2011-09-01 20:12, Luiz Capitulino wrote:
> 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 <address@hidden>
> ---
> cpus.c | 1 +
> migration.c | 8 +++++++-
> sysemu.h | 10 +++++++++-
> vl.c | 20 ++++++++++++++++++++
> 4 files changed, 37 insertions(+), 2 deletions(-)
>
...
> diff --git a/vl.c b/vl.c
> index f0b56a4..59f71fc 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -321,6 +321,22 @@ static int default_driver_check(QemuOpts *opts, void
> *opaque)
> }
>
> /***********************************************************/
> +/* QEMU state */
> +
> +static RunState current_run_state = RSTATE_NO_STATE;
> +
> +bool runstate_check(RunState state)
> +{
> + return current_run_state == state;
> +}
> +
> +void runstate_set(RunState state)
> +{
> + assert(state < RSTATE_MAX);
> + current_run_state = state;
I still think this should check for valid state transitions instead of
blindly accepting what the caller passes in.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
- [Qemu-devel] [PATCH v3 0/8]: Introduce the RunState type, Luiz Capitulino, 2011/09/01
- [Qemu-devel] [PATCH 1/8] Move vm_state_notify() prototype from cpus.h to sysemu.h, Luiz Capitulino, 2011/09/01
- [Qemu-devel] [PATCH 3/8] RunState: Add additional states, Luiz Capitulino, 2011/09/01
- Re: [Qemu-devel] [PATCH 3/8] RunState: Add additional states,
Jan Kiszka <=
- Re: [Qemu-devel] [PATCH 3/8] RunState: Add additional states, Luiz Capitulino, 2011/09/01
- Re: [Qemu-devel] [PATCH 3/8] RunState: Add additional states, Jan Kiszka, 2011/09/01
- Re: [Qemu-devel] [PATCH 3/8] RunState: Add additional states, Luiz Capitulino, 2011/09/02
- Re: [Qemu-devel] [PATCH 3/8] RunState: Add additional states, Jan Kiszka, 2011/09/02
- Re: [Qemu-devel] [PATCH 3/8] RunState: Add additional states, Luiz Capitulino, 2011/09/02
- Re: [Qemu-devel] [PATCH 3/8] RunState: Add additional states, Luiz Capitulino, 2011/09/06
[Qemu-devel] [PATCH 2/8] Replace the VMSTOP macros with a proper state type, Luiz Capitulino, 2011/09/01
[Qemu-devel] [PATCH 4/8] Drop the incoming_expected global variable, Luiz Capitulino, 2011/09/01
[Qemu-devel] [PATCH 5/8] Drop the vm_running global variable, Luiz Capitulino, 2011/09/01
[Qemu-devel] [PATCH 8/8] HMP: info status: Print the VM state, Luiz Capitulino, 2011/09/01