From: Luiz Capitulino <lcapitulino@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] runstate: add more valid transitions
Date: Tue, 11 Oct 2011 14:52:48 -0300 [thread overview]
Message-ID: <20111011145248.4ef5e39b@doriath> (raw)
In-Reply-To: <1318317762-20956-1-git-send-email-pbonzini@redhat.com>
On Tue, 11 Oct 2011 09:22:42 +0200
Paolo Bonzini <pbonzini@redhat.com> wrote:
> This patch adds more valid transitions to the table, and avoids
> that the VM remains stuck in RSTATE_SAVEVM state when savevm is
> done on a paused virtual machine.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Applied to the qmp branch, thanks.
> ---
> savevm.c | 9 +++++++--
> vl.c | 5 +++++
> 2 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/savevm.c b/savevm.c
> index bf4d0e7..ac45db8 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -1626,8 +1626,13 @@ out:
> if (qemu_file_has_error(f))
> ret = -EIO;
>
> - if (!ret && saved_vm_running)
> - vm_start();
> + if (!ret) {
> + if (saved_vm_running) {
> + vm_start();
> + } else {
> + runstate_set(RSTATE_PAUSED);
> + }
> + }
>
> return ret;
> }
> diff --git a/vl.c b/vl.c
> index dbf7778..6614aac 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -343,8 +343,12 @@ static const RunStateTransition runstate_transitions_def[] = {
> { RUN_STATE_IO_ERROR, RUN_STATE_RUNNING },
>
> { RUN_STATE_PAUSED, RUN_STATE_RUNNING },
> + { RUN_STATE_PAUSED, RUN_STATE_FINISH_MIGRATE },
> + { RUN_STATE_PAUSED, RUN_STATE_SAVE_VM },
>
> { RUN_STATE_POSTMIGRATE, RUN_STATE_RUNNING },
> + { RUN_STATE_POSTMIGRATE, RUN_STATE_FINISH_MIGRATE },
> + { RUN_STATE_POSTMIGRATE, RUN_STATE_SAVE_VM },
>
> { RUN_STATE_PRELAUNCH, RUN_STATE_RUNNING },
> { RUN_STATE_PRELAUNCH, RUN_STATE_INMIGRATE },
> @@ -366,6 +370,7 @@ static const RunStateTransition runstate_transitions_def[] = {
> { RUN_STATE_RUNNING, RUN_STATE_WATCHDOG },
>
> { RUN_STATE_SAVE_VM, RUN_STATE_RUNNING },
> + { RUN_STATE_SAVE_VM, RUN_STATE_PAUSED },
>
> { RUN_STATE_SHUTDOWN, RUN_STATE_PAUSED },
>
next prev parent reply other threads:[~2011-10-11 17:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-04 13:10 [Qemu-devel] [PATCH] runstate: add more valid transitions Paolo Bonzini
2011-10-04 13:15 ` [Qemu-devel] [PATCH v2] " Paolo Bonzini
2011-10-10 18:50 ` Luiz Capitulino
2011-10-11 7:22 ` Paolo Bonzini
2011-10-11 17:52 ` Luiz Capitulino [this message]
2011-10-13 20:26 ` Luiz Capitulino
2011-10-14 6:56 ` Paolo Bonzini
2011-10-14 13:23 ` Luiz Capitulino
2011-10-14 13:37 ` Paolo Bonzini
2011-10-14 14:24 ` Luiz Capitulino
2011-10-14 14:26 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111011145248.4ef5e39b@doriath \
--to=lcapitulino@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).