From patchwork Tue Mar 27 15:50:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 148980 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 20275B6EEC for ; Wed, 28 Mar 2012 02:49:25 +1100 (EST) Received: from localhost ([::1]:48088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCYeA-0006Ux-UX for incoming@patchwork.ozlabs.org; Tue, 27 Mar 2012 11:49:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:32955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCYdw-0006Sm-Ip for qemu-devel@nongnu.org; Tue, 27 Mar 2012 11:49:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCYdq-0005T3-Cc for qemu-devel@nongnu.org; Tue, 27 Mar 2012 11:49:08 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:53819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCYdq-0005Sd-8N; Tue, 27 Mar 2012 11:49:02 -0400 X-IronPort-AV: E=Sophos;i="4.75,327,1330923600"; d="scan'208";a="187771982" Received: from ftlpmailmx01.citrite.net ([10.13.107.65]) by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5; 27 Mar 2012 11:48:59 -0400 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.65) with Microsoft SMTP Server id 8.3.213.0; Tue, 27 Mar 2012 11:48:58 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59] helo=localhost.localdomain) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1SCYdh-0000pf-7g; Tue, 27 Mar 2012 16:48:53 +0100 From: Stefano Stabellini To: anthony@codemonkey.ws Date: Tue, 27 Mar 2012 16:50:06 +0100 Message-ID: <1332863406-358-2-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.63 Cc: aliguori@us.ibm.com, Stefano Stabellini , qemu-stable@nongnu.org, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 2/2] xen_disk: when using AIO flush after the operation is completed X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org If ioreq->postsync call bdrv_flush when the AIO operation is actually completed. Signed-off-by: Stefano Stabellini --- hw/xen_disk.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/xen_disk.c b/hw/xen_disk.c index 0f265a4..9cb0253 100644 --- a/hw/xen_disk.c +++ b/hw/xen_disk.c @@ -330,6 +330,9 @@ static void qemu_aio_complete(void *opaque, int ret) if (ioreq->aio_inflight > 0) { return; } + if (ioreq->postsync) { + bdrv_flush(ioreq->blkdev->bs); + } ioreq->status = ioreq->aio_errors ? BLKIF_RSP_ERROR : BLKIF_RSP_OKAY; ioreq_unmap(ioreq); @@ -376,9 +379,6 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq) goto err; } - if (ioreq->postsync) { - bdrv_flush(blkdev->bs); /* FIXME: aio_flush() ??? */ - } qemu_aio_complete(ioreq, 0); return 0;