From: Luiz Capitulino <lcapitulino@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qmp: handle stop/cont in INMIGRATE state
Date: Thu, 18 Oct 2012 13:42:56 -0300 [thread overview]
Message-ID: <20121018134256.5f6d745d@doriath.home> (raw)
In-Reply-To: <1350551662-18408-1-git-send-email-pbonzini@redhat.com>
On Thu, 18 Oct 2012 11:14:22 +0200
Paolo Bonzini <pbonzini@redhat.com> wrote:
> Right now, stop followed by an incoming migration will let the
> virtual machine start. cont before an incoming migration instead
> will fail.
>
> This is bad because the actual behavior is not predictable; it is
> racy with respect to the start of the incoming migration. That's
> because incoming migration is blocking, and thus will delay the
> processing of stop/cont until the end of the migration.
That's not correct if "delay" means "it will be queued" (I guess you
didn't mean that, but "blocking" followed "will delay the processing"
gives that impression).
What happens is that a stop command while in INMIGRATE state will just
be ignored. Actually, any stops while in a state that pauses vCPUs are
ignored.
Also, I don't understand what you meant by "racy", care to elaborate?
> In addition, there's nothing that really prevents the user from
> typing the block device's passwords before incoming migration is
> done, so we may as well allow that.
Have you tried it? We seem to support that already.
> Both things can be fixed by just toggling the autostart variable when
> stop/cont are called in INMIGRATE state.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> qmp.c | 17 +++++++++++------
> 1 file modificato, 11 inserzioni(+), 6 rimozioni(-)
>
> diff --git a/qmp.c b/qmp.c
> index 36c54c5..2c8d559 100644
> --- a/qmp.c
> +++ b/qmp.c
> @@ -85,7 +85,11 @@ void qmp_quit(Error **err)
>
> void qmp_stop(Error **errp)
> {
> - vm_stop(RUN_STATE_PAUSED);
> + if (runstate_check(RUN_STATE_INMIGRATE)) {
> + autostart = 0;
I'm not against this change, but it has two issues. First, after the
incoming migration ends, the state will be PRELAUNCH; so we have to
decide if this is a good state for this and if it is, then we have to
update its schema doc.
The other (possible) problem is that we're changing the semantics of
the stop command on INMIGRATE. I can't tell if this actually matters, but
it could come back in the form of compatibility breakage. This is also
true for the cont change below.
> + } else {
> + vm_stop(RUN_STATE_PAUSED);
> + }
> }
>
> void qmp_system_reset(Error **errp)
> @@ -144,10 +148,7 @@ void qmp_cont(Error **errp)
> {
> Error *local_err = NULL;
>
> - if (runstate_check(RUN_STATE_INMIGRATE)) {
> - error_set(errp, QERR_MIGRATION_EXPECTED);
Please, drop QERR_MIGRATION_EXPECTED.
> - return;
> - } else if (runstate_check(RUN_STATE_INTERNAL_ERROR) ||
> + if (runstate_check(RUN_STATE_INTERNAL_ERROR) ||
> runstate_check(RUN_STATE_SHUTDOWN)) {
> error_set(errp, QERR_RESET_REQUIRED);
> return;
> @@ -162,7 +163,11 @@ void qmp_cont(Error **errp)
> return;
> }
>
> - vm_start();
> + if (runstate_check(RUN_STATE_INMIGRATE)) {
> + autostart = 1;
> + } else {
> + vm_start();
> + }
> }
>
> void qmp_system_wakeup(Error **errp)
next prev parent reply other threads:[~2012-10-18 16:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-18 9:14 [Qemu-devel] [PATCH] qmp: handle stop/cont in INMIGRATE state Paolo Bonzini
2012-10-18 16:42 ` Luiz Capitulino [this message]
2012-10-19 9:27 ` Paolo Bonzini
2012-10-19 13:23 ` Luiz Capitulino
2012-10-19 13:50 ` Paolo Bonzini
2012-10-19 14:02 ` Luiz Capitulino
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=20121018134256.5f6d745d@doriath.home \
--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).