From patchwork Tue Nov 30 13:34:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 73815 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B879FB708B for ; Thu, 2 Dec 2010 00:09:38 +1100 (EST) Received: from localhost ([127.0.0.1]:41122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNmRD-0001tj-UI for incoming@patchwork.ozlabs.org; Wed, 01 Dec 2010 08:09:36 -0500 Received: from [140.186.70.92] (port=45226 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNef8-0007ED-8c for qemu-devel@nongnu.org; Tue, 30 Nov 2010 23:51:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PNQM6-0006Ec-9O for qemu-devel@nongnu.org; Tue, 30 Nov 2010 08:34:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:26603) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PNQM6-0006EQ-1G for qemu-devel@nongnu.org; Tue, 30 Nov 2010 08:34:50 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAUDYlgH001601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 30 Nov 2010 08:34:47 -0500 Received: from redhat.com (vpn-200-3.tlv.redhat.com [10.35.200.3]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id oAUDYiUW020711; Tue, 30 Nov 2010 08:34:45 -0500 Date: Tue, 30 Nov 2010 15:34:29 +0200 From: "Michael S. Tsirkin" To: Marcelo Tosatti Subject: Re: [Qemu-devel] [PATCHv2 2/6] cpus: flush all requests on each vm stop Message-ID: <20101130133428.GB18301@redhat.com> References: <732b3c1a27c2d274989328218bb5e831b28686dd.1290613959.git.mst@redhat.com> <20101130124540.GA480@amt.cnet> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20101130124540.GA480@amt.cnet> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: jasowang@redhat.com, qemu-devel@nongnu.org, quintela@redhat.com X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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); }