From patchwork Wed Jan 9 18:41:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 210816 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 1F8EB2C0172 for ; Thu, 10 Jan 2013 05:44:10 +1100 (EST) Received: from localhost ([::1]:59299 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tt0dE-0006ZD-9d for incoming@patchwork.ozlabs.org; Wed, 09 Jan 2013 13:44:08 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tt0av-0005vS-AD for qemu-devel@nongnu.org; Wed, 09 Jan 2013 13:41:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tt0as-0002tC-57 for qemu-devel@nongnu.org; Wed, 09 Jan 2013 13:41:45 -0500 Received: from smtp.citrix.com ([66.165.176.89]:20895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tt0as-0002ss-0H for qemu-devel@nongnu.org; Wed, 09 Jan 2013 13:41:42 -0500 X-IronPort-AV: E=Sophos;i="4.84,439,1355097600"; d="scan'208";a="3222191" Received: from unknown (HELO FTLPEX01CL03.citrite.net) ([10.13.107.80]) by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA; 09 Jan 2013 18:41:40 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.2.318.1; Wed, 9 Jan 2013 13:41:39 -0500 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1Tt0ap-0007g1-IR; Wed, 09 Jan 2013 18:41:39 +0000 Date: Wed, 9 Jan 2013 18:41:35 +0000 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: "qemu-devel@nongnu.org" Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.89 Cc: "xen-devel@lists.xensource.com" , "konrad.wilk@oracle.com" , Stefano Stabellini Subject: [Qemu-devel] [PATCH v2] xen_disk: implement BLKIF_OP_FLUSH_DISKCACHE, remove BLKIF_OP_WRITE_BARRIER 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 Signed-off-by: Stefano Stabellini Changes in v2: - BLKIF_OP_FLUSH_DISKCACHE implies a preflush, not a postflush. diff --git a/hw/xen_disk.c b/hw/xen_disk.c index a6a64a2..2d0de09 100644 --- a/hw/xen_disk.c +++ b/hw/xen_disk.c @@ -182,12 +182,11 @@ static int ioreq_parse(struct ioreq *ioreq) case BLKIF_OP_READ: ioreq->prot = PROT_WRITE; /* to memory */ break; - case BLKIF_OP_WRITE_BARRIER: + case BLKIF_OP_FLUSH_DISKCACHE: + ioreq->presync = 1; if (!ioreq->req.nr_segments) { - ioreq->presync = 1; return 0; } - ioreq->presync = ioreq->postsync = 1; /* fall through */ case BLKIF_OP_WRITE: ioreq->prot = PROT_READ; /* from memory */ @@ -369,7 +368,7 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq) qemu_aio_complete, ioreq); break; case BLKIF_OP_WRITE: - case BLKIF_OP_WRITE_BARRIER: + case BLKIF_OP_FLUSH_DISKCACHE: if (!ioreq->req.nr_segments) { break; } @@ -654,7 +653,7 @@ static int blk_init(struct XenDevice *xendev) blkdev->file_size, blkdev->file_size >> 20); /* fill info */ - xenstore_write_be_int(&blkdev->xendev, "feature-barrier", 1); + xenstore_write_be_int(&blkdev->xendev, "feature-flush-cache", 1); xenstore_write_be_int(&blkdev->xendev, "info", info); xenstore_write_be_int(&blkdev->xendev, "sector-size", blkdev->file_blk); xenstore_write_be_int(&blkdev->xendev, "sectors",