From: Paolo Bonzini <pbonzini@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Jan Kiszka <jan.kiszka@web.de>, Avi Kivity <avi@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused
Date: Thu, 06 Oct 2011 13:14:56 +0200 [thread overview]
Message-ID: <4E8D8DB0.1050106@redhat.com> (raw)
In-Reply-To: <20111005155026.62fa9071@doriath>
On 10/05/2011 08:50 PM, Luiz Capitulino wrote:
>>>> > > > I'm not exactly against the semantics you're proposing, but they don't
>>>> > > > seem to fit today's qemu.
>>> > >
>>> > > Today's qemu is broken here.
>> >
>> > For me it's broken because it will abort() if you migrate a paused vm, for
>> > you it seems to be broken at the semantic level.
>> >
>> > We can fix the semantics without breaking compatibility.
>
> s/We can/ We can't
I think we should divide stop causes into three groups:
1) those that are undone by QEMU itself:
RSTATE_DEBUG
RSTATE_SAVEVM
RSTATE_PRE_MIGRATE
RSTATE_RESTORE
For these a lock/release scheme is definitely better. The VM should not
start until none of these conditions is in effect, even after a "cont"
command.
2) those that are undone by management:
RSTATE_IO_ERROR
For this we can add a new "retry" monitor command that guarantees no
races if the user issues a "stop" or "cont" command while management is
processing it. Effectively, it is also a lock/release scheme but
controlled by management.
3) those that are undone by "cont":
RSTATE_PRE_LAUNCH
RSTATE_PAUSED
RSTATE_WATCHDOG
RSTATE_POST_MIGRATE
RSTATE_PANICKED
It put here the three runstates where the VM should really not be
restarted at all. We can then add a new "start" command that only flips
these five to RSTATE_RUNNING.
So the runstate is composed of six elements: five lock/unlock states (of
which only one can be unlocked by the user), and one running/paused
state (composed of five pause reasons + "none"). That is, the runstate
is a tuple like [debug, savevm, pre_migrate, restore, io_error,
pause_reason] and for the VM to run it must look like [false, false,
false, false, false, none].
The four monitor commands would be:
1) "stop":
if runstate[pause_reason] == none then
runstate[pause_reason] = paused
2) "retry":
runstate[io_error] = false
3) "start":
runstate[pause_reason] = none
There could also be a differentiation between "start" and "start -f",
where "-f" would be needed to get out of RSTATE_POST_MIGRATE,
RSTATE_PANICKED and probably RSTATE_WATCHDOG too.
4) "cont": backwards compatibility provided by "retry"+"start -f".
How does this look?
Paolo
next prev parent reply other threads:[~2011-10-06 11:15 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-04 12:04 [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused Paolo Bonzini
2011-10-04 13:49 ` Luiz Capitulino
2011-10-04 14:09 ` Paolo Bonzini
2011-10-04 14:30 ` Luiz Capitulino
2011-10-05 14:37 ` Luiz Capitulino
2011-10-05 15:43 ` Avi Kivity
2011-10-05 15:44 ` Avi Kivity
2011-10-05 16:31 ` Jan Kiszka
2011-10-05 16:37 ` Avi Kivity
2011-10-05 16:49 ` Jan Kiszka
2011-10-05 17:12 ` Avi Kivity
2011-10-05 18:02 ` Jan Kiszka
2011-10-06 14:27 ` Avi Kivity
2011-10-06 15:08 ` Jan Kiszka
2011-10-05 17:02 ` Luiz Capitulino
2011-10-05 17:23 ` Avi Kivity
2011-10-05 17:39 ` Luiz Capitulino
2011-10-05 18:02 ` Avi Kivity
2011-10-05 18:49 ` Luiz Capitulino
2011-10-05 18:50 ` Luiz Capitulino
2011-10-06 11:14 ` Paolo Bonzini [this message]
2011-10-10 18:49 ` 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=4E8D8DB0.1050106@redhat.com \
--to=pbonzini@redhat.com \
--cc=avi@redhat.com \
--cc=jan.kiszka@web.de \
--cc=lcapitulino@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.