Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-10 Thread Luiz Capitulino
On Tue, 4 Oct 2011 14:04:45 +0200 Paolo Bonzini wrote: > Trying to migrate a paused machine fails. The reason is that > the RSTATE_PRE_MIGRATE is reached with vm_stop, and this > transition is eaten when the vm is already paused. This patch > fixes the problem by always going through runstate_

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-06 Thread Jan Kiszka
On 2011-10-06 16:27, Avi Kivity wrote: > On 10/05/2011 08:02 PM, Jan Kiszka wrote: >> > >> > Let's examine a concrete example: a user is debugging a guest, which >> > stops at a breakpoint. Meanwhile a live migration is going on, >> > involving internal stops. When the guest does manage to run

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-06 Thread Avi Kivity
On 10/05/2011 08:02 PM, Jan Kiszka wrote: > > Let's examine a concrete example: a user is debugging a guest, which > stops at a breakpoint. Meanwhile a live migration is going on, > involving internal stops. When the guest does manage to run for a bit, > it runs out of disk space, generatin

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-06 Thread Paolo Bonzini
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 see

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-05 Thread Luiz Capitulino
On Wed, 5 Oct 2011 15:49:42 -0300 Luiz Capitulino wrote: > On Wed, 05 Oct 2011 20:02:04 +0200 > Avi Kivity wrote: > > > On 10/05/2011 07:39 PM, Luiz Capitulino wrote: > > > On Wed, 05 Oct 2011 19:23:21 +0200 > > > Avi Kivity wrote: > > > > > > > On 10/05/2011 07:02 PM, Luiz Capitulino wrote:

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-05 Thread Luiz Capitulino
On Wed, 05 Oct 2011 20:02:04 +0200 Avi Kivity wrote: > On 10/05/2011 07:39 PM, Luiz Capitulino wrote: > > On Wed, 05 Oct 2011 19:23:21 +0200 > > Avi Kivity wrote: > > > > > On 10/05/2011 07:02 PM, Luiz Capitulino wrote: > > > > On Wed, 05 Oct 2011 18:37:51 +0200 > > > > Avi Kivity wrote:

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-05 Thread Jan Kiszka
On 2011-10-05 19:12, Avi Kivity wrote: > On 10/05/2011 06:49 PM, Jan Kiszka wrote: >> On 2011-10-05 18:37, Avi Kivity 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

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-05 Thread Avi Kivity
On 10/05/2011 07:39 PM, Luiz Capitulino wrote: On Wed, 05 Oct 2011 19:23:21 +0200 Avi Kivity wrote: > On 10/05/2011 07:02 PM, Luiz Capitulino wrote: > > On Wed, 05 Oct 2011 18:37:51 +0200 > > Avi Kivity wrote: > > > > > On 10/05/2011 06:31 PM, Jan Kiszka wrote: > > > > >> > >

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-05 Thread Luiz Capitulino
On Wed, 05 Oct 2011 19:23:21 +0200 Avi Kivity wrote: > On 10/05/2011 07:02 PM, Luiz Capitulino wrote: > > On Wed, 05 Oct 2011 18:37:51 +0200 > > Avi Kivity wrote: > > > > > On 10/05/2011 06:31 PM, Jan Kiszka wrote: > > > > >> > > > > > > > > > > vm_start() should be symmetric with vm_st

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-05 Thread Avi Kivity
On 10/05/2011 07:02 PM, Luiz Capitulino wrote: On Wed, 05 Oct 2011 18:37:51 +0200 Avi Kivity 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,

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-05 Thread Avi Kivity
On 10/05/2011 06:49 PM, Jan Kiszka wrote: On 2011-10-05 18:37, Avi Kivity 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 >

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-05 Thread Luiz Capitulino
On Wed, 05 Oct 2011 18:37:51 +0200 Avi Kivity 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. > > > >

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-05 Thread Jan Kiszka
On 2011-10-05 18:37, Avi Kivity 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

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-05 Thread Avi Kivity
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

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-05 Thread Jan Kiszka
On 2011-10-05 17:43, Avi Kivity wrote: > On 10/05/2011 04:37 PM, Luiz Capitulino wrote: >> Now, we have three options to fix this but I don't know which one to >> choose: >> >> 1. We could just add the transition RSTATE_PAUSED -> >> RSTATE_POST_MIGRATE >> as valid. Not sure this is a good t

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-05 Thread Avi Kivity
On 10/05/2011 05:43 PM, Avi Kivity wrote: On 10/05/2011 04:37 PM, Luiz Capitulino wrote: Now, we have three options to fix this but I don't know which one to choose: 1. We could just add the transition RSTATE_PAUSED -> RSTATE_POST_MIGRATE as valid. Not sure this is a good thing to do

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-05 Thread Avi Kivity
On 10/05/2011 04:37 PM, Luiz Capitulino wrote: Now, we have three options to fix this but I don't know which one to choose: 1. We could just add the transition RSTATE_PAUSED -> RSTATE_POST_MIGRATE as valid. Not sure this is a good thing to do though, as it seems a silly workaround f

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-05 Thread Luiz Capitulino
On Tue, 4 Oct 2011 14:04:45 +0200 Paolo Bonzini wrote: > Trying to migrate a paused machine fails. The reason is that > the RSTATE_PRE_MIGRATE is reached with vm_stop, and this > transition is eaten when the vm is already paused. This patch > fixes the problem by always going through runstate_

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-04 Thread Luiz Capitulino
On Tue, 04 Oct 2011 16:09:03 +0200 Paolo Bonzini wrote: > On 10/04/2011 03:49 PM, Luiz Capitulino wrote: > > There's a semantic change which I'm not completely sure it won't generate > > unexpected side-effects: today vm_stop() will only carry any action if the > > machine is running, otherwise i

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-04 Thread Paolo Bonzini
On 10/04/2011 03:49 PM, Luiz Capitulino wrote: There's a semantic change which I'm not completely sure it won't generate unexpected side-effects: today vm_stop() will only carry any action if the machine is running, otherwise it's no-op. This patch changes that. More or less, yes. I tried to l

Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-04 Thread Luiz Capitulino
On Tue, 4 Oct 2011 14:04:45 +0200 Paolo Bonzini wrote: > Trying to migrate a paused machine fails. The reason is that > the RSTATE_PRE_MIGRATE is reached with vm_stop, and this > transition is eaten when the vm is already paused. This patch > fixes the problem by always going through runstate_

[Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused

2011-10-04 Thread Paolo Bonzini
Trying to migrate a paused machine fails. The reason is that the RSTATE_PRE_MIGRATE is reached with vm_stop, and this transition is eaten when the vm is already paused. This patch fixes the problem by always going through runstate_set and always notifying the new state. Signed-off-by: Paolo Bonz