From: Luiz Capitulino <lcapitulino@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Jan Kiszka <jan.kiszka@web.de>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused
Date: Wed, 5 Oct 2011 15:50:26 -0300 [thread overview]
Message-ID: <20111005155026.62fa9071@doriath> (raw)
In-Reply-To: <20111005154942.1ee4e153@doriath>
On Wed, 5 Oct 2011 15:49:42 -0300
Luiz Capitulino <lcapitulino@redhat.com> wrote:
> On Wed, 05 Oct 2011 20:02:04 +0200
> Avi Kivity <avi@redhat.com> wrote:
>
> > On 10/05/2011 07:39 PM, Luiz Capitulino wrote:
> > > On Wed, 05 Oct 2011 19:23:21 +0200
> > > Avi Kivity<avi@redhat.com> wrote:
> > >
> > > > On 10/05/2011 07:02 PM, Luiz Capitulino wrote:
> > > > > On Wed, 05 Oct 2011 18:37:51 +0200
> > > > > Avi Kivity<avi@redhat.com> wrote:
> > > > >
> > > > > > On 10/05/2011 06:31 PM, Jan Kiszka wrote:
> > > > > > > >>
> > > > > > > >
> > > > > > > > vm_start() should be symmetric with vm_stop(). That is, if a piece of
> > > > > > > > code wants to execute with vcpus stopped, it should just run inside a
> > > > > > > > stop/start pair.
> > > > > > > >
> > > > > > > > The only confusion can come from the user, if he sees multiple stop
> > > > > > > > events and expects that just one cont will continue the vm. For the
> > > > > > > > machine monitor, we should just document that the you have to issue one
> > > > > > > > cont for every stop event you see (plus any stops you issue). It's not
> > > > > > > > unnatural - the code that handles a stop_due_to_enospace can work to fix
> > > > > > > > the error and issue a cont, disregarding any other stops in progress
> > > > > > > > (due to a user pressing the stop button, or migration, or cpu hotplug,
> > > > > > > > or whatever). For the human monitor, it's not so intuitive, but the
> > > > > > > > situation is so rare we can just rely on the user to issue cont again.
> > > > > > >
> > > > > > > Making this kind of user-visible change would be a bad idea.
> > > > > >
> > > > > > The current situation is a bad idea.
> > > > >
> > > > > Let's take the migration use-case as an example (ie. the user stops the VM
> > > > > before performing the migration). Today, if migration fails,
> > > > > migrate_fd_put_ready() will call vm_start() which will put the VM to
> > > > > run again.
> > > > >
> > > > > But if we implement the ref count idea, then vm_start() will just "unlock"
> > > > > migrate_fd_put_ready()'s own call to vm_stop(), that's, the user stop will
> > > > > remain and the user is required to do a 'cont'.
> > > > >
> > > > > I'd probably agree that that's the ideal semantics, but chances are we're
> > > > > going to break qmp clients here.
> > > >
> > > > There are two questions here. Is this autostart desirable? (IMO no,
> > > > but haven't given it much thought).
> > >
> > > It should be configurable at migration time I think.
> >
> > Why? autostart can easily be emulated by non-autostart, but not vice versa.
>
> What I meant is to give the user the choice to use.
>
> > > > If yes, we should provide it
> > > > somehow. If not, we should default to providing it, but switch to
> > > > non-autostart if a newer client indicates it understands the new semantics.
> > >
> > > That's only one example. You mention another one above: if qemu stops
> > > itself twice, will the user be required to run 'cont' twice?
> >
> > Yes. That's how the user tells qemu it saw the two events and handled
> > both of them. Otherwise there is a race condition and an event goes
> > unhandled (or rather, it is handled while the guest is running instead
> > of stopped).
>
> Breaks compatibility.
>
> > > 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
next prev parent reply other threads:[~2011-10-05 18:50 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 [this message]
2011-10-06 11:14 ` Paolo Bonzini
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=20111005155026.62fa9071@doriath \
--to=lcapitulino@redhat.com \
--cc=avi@redhat.com \
--cc=jan.kiszka@web.de \
--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).