]> xenbits.xensource.com Git - qemu-xen-4.5-testing.git/commitdiff
qemu-xen-traditional: use O_DIRECT to open disk images with QDISK
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Mon, 2 Apr 2012 16:54:36 +0000 (17:54 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 2 Apr 2012 16:55:55 +0000 (17:55 +0100)
Also enable batch_maps, use_aio and disable syncwrite.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
hw/xen_disk.c

index 6aebb77ba780631dac6e8c315f3fcefd57c4a5fb..b1d698510cdc1a9a4196dd74821bffb09f443a4d 100644 (file)
 
 /* ------------------------------------------------------------- */
 
-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;
     }