From: Stefano Stabellini Subject: [PATCH 2/3] qemu-xen-traditional: use O_DIRECT to open disk images with QDISK Date: Fri, 23 Mar 2012 14:51:28 +0000 Message-ID: <1332514289-28129-2-git-send-email-stefano.stabellini@eu.citrix.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xensource.com Cc: Ian.Jackson@eu.citrix.com, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Also enable batch_maps, use_aio and disable syncwrite. Signed-off-by: Stefano Stabellini --- hw/xen_disk.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/xen_disk.c b/hw/xen_disk.c index 6aebb77..b1d6985 100644 --- a/hw/xen_disk.c +++ b/hw/xen_disk.c @@ -46,11 +46,11 @@ /* ------------------------------------------------------------- */ -static int syncwrite = 1; -static int batch_maps = 0; +static int syncwrite = 0; +static int batch_maps = 1; static int max_requests = 32; -static int use_aio = 0; +static int use_aio = 1; /* ------------------------------------------------------------- */ @@ -617,12 +617,13 @@ static int blk_init(struct XenDevice *xendev) return -1; /* read-only ? */ + qflags = BDRV_O_NOCACHE; if (strcmp(blkdev->mode, "w") == 0) { mode = O_RDWR; - qflags = BDRV_O_RDWR; + qflags |= BDRV_O_RDWR; } else { mode = O_RDONLY; - qflags = BDRV_O_RDONLY; + qflags |= BDRV_O_RDONLY; info |= VDISK_READONLY; } -- 1.7.2.5