qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCHv2 2/6] cpus: flush all requests on each vm stop


From: Marcelo Tosatti
Subject: Re: [Qemu-devel] [PATCHv2 2/6] cpus: flush all requests on each vm stop
Date: Fri, 3 Dec 2010 14:30:18 -0200
User-agent: Mutt/1.5.20 (2009-08-17)

On Tue, Nov 30, 2010 at 04:05:31PM +0200, Michael S. Tsirkin wrote:
> On Tue, Nov 30, 2010 at 11:46:48AM -0200, Marcelo Tosatti wrote:
> > On Tue, Nov 30, 2010 at 03:34:29PM +0200, Michael S. Tsirkin wrote:
> > > On Tue, Nov 30, 2010 at 10:45:40AM -0200, Marcelo Tosatti wrote:
> > > > On Wed, Nov 24, 2010 at 05:52:58PM +0200, Michael S. Tsirkin wrote:
> > > > > Make sure disk is in consistent state.
> > > > > 
> > > > > Signed-off-by: Michael S. Tsirkin <address@hidden>
> > > > > Tested-by: Jason Wang <address@hidden>
> > > > > ---
> > > > >  cpus.c |    2 ++
> > > > >  1 files changed, 2 insertions(+), 0 deletions(-)
> > > > > 
> > > > > diff --git a/cpus.c b/cpus.c
> > > > > index 91a0fb1..d421a96 100644
> > > > > --- a/cpus.c
> > > > > +++ b/cpus.c
> > > > > @@ -110,6 +110,8 @@ static void do_vm_stop(int reason)
> > > > >          cpu_disable_ticks();
> > > > >          vm_running = 0;
> > > > >          pause_all_vcpus();
> > > > > +        qemu_aio_flush();
> > > > > +        bdrv_flush_all();
> > > > 
> > > > Can you move these after vm_state_notify? qemu-kvm stops vcpus there.
> > > > 
> > > > >          vm_state_notify(0, reason);
> > > > >          monitor_protocol_event(QEVENT_STOP, NULL);
> > > > >      }
> > > 
> > > Like this:
> > > 
> > > cpus: flush all requests on each vm stop
> > > 
> > > Make sure disk is in consistent state.
> > > 
> > > Signed-off-by: Michael S. Tsirkin <address@hidden>
> > > Tested-by: Jason Wang <address@hidden>
> > > 
> > > ---
> > > 
> > > diff --git a/cpus.c b/cpus.c
> > > index 91a0fb1..d421a96 100644
> > > --- a/cpus.c
> > > +++ b/cpus.c
> > > @@ -110,6 +110,8 @@ static void do_vm_stop(int reason)
> > >          cpu_disable_ticks();
> > >          vm_running = 0;
> > >          pause_all_vcpus();
> > > +        qemu_aio_flush();
> > > +        bdrv_flush_all();
> > >          vm_state_notify(0, reason);
> > >          monitor_protocol_event(QEVENT_STOP, NULL);
> > >      }
> > 
> > No, after vm_state_notify.
> 
> 
> Like this then:
> 
> 
>     cpus: flush all requests on each vm stop
>     
>     Flush all requests once we have stopped all
>     cpus and devices.
>     Make sure disk is in consistent state.
>     
>     Signed-off-by: Michael S. Tsirkin <address@hidden>
>     Tested-by: Jason Wang <address@hidden>
> 
> diff --git a/cpus.c b/cpus.c
> index 91a0fb1..0309189 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -111,6 +111,8 @@ static void do_vm_stop(int reason)
>          vm_running = 0;
>          pause_all_vcpus();
>          vm_state_notify(0, reason);
> +        qemu_aio_flush();
> +        bdrv_flush_all();
>          monitor_protocol_event(QEVENT_STOP, NULL);
>      }
>  }

ACK.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]