From: Stefano Stabellini Date: Mon, 2 Apr 2012 16:54:36 +0000 (+0100) Subject: qemu-xen-traditional: use O_DIRECT to open disk images with QDISK X-Git-Tag: xen-4.2.0-rc1~13 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0efae2f1fe8f72628c58b3683f62725a613fcec3;p=qemu-xen-4.4-testing.git qemu-xen-traditional: use O_DIRECT to open disk images with QDISK Also enable batch_maps, use_aio and disable syncwrite. Signed-off-by: Stefano Stabellini Acked-by: Ian Jackson --- diff --git a/hw/xen_disk.c b/hw/xen_disk.c index 6aebb77ba..b1d698510 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; }