From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58575 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POYdg-0004FD-Ay for qemu-devel@nongnu.org; Fri, 03 Dec 2010 11:37:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1POYde-0002Dj-Sm for qemu-devel@nongnu.org; Fri, 03 Dec 2010 11:37:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1POYde-0002DN-Lr for qemu-devel@nongnu.org; Fri, 03 Dec 2010 11:37:38 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB3GbY93030925 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 3 Dec 2010 11:37:34 -0500 Date: Fri, 3 Dec 2010 14:30:18 -0200 From: Marcelo Tosatti Subject: Re: [Qemu-devel] [PATCHv2 2/6] cpus: flush all requests on each vm stop Message-ID: <20101203163018.GA20436@amt.cnet> References: <732b3c1a27c2d274989328218bb5e831b28686dd.1290613959.git.mst@redhat.com> <20101130124540.GA480@amt.cnet> <20101130133428.GB18301@redhat.com> <20101130134648.GA2102@amt.cnet> <20101130140531.GA20536@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101130140531.GA20536@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: jasowang@redhat.com, qemu-devel@nongnu.org, quintela@redhat.com 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 > > > > > Tested-by: Jason Wang > > > > > --- > > > > > 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 > > > Tested-by: Jason Wang > > > > > > --- > > > > > > 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 > Tested-by: Jason Wang > > 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.