aboutsummaryrefslogtreecommitdiff
path: root/hw/xen_disk.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-03-28 12:46:39 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-03-28 12:46:39 -0500
commitcbd5979bb2ca8609ef19ebdfdc46043c46f0b42e (patch)
tree0891d9c797563eee368abcbf23de238d181078b0 /hw/xen_disk.c
parent49e00ba9698469b5eccec947050216192d9a9e34 (diff)
parentd56de074698662b102a1901e3bae425f8e4945bf (diff)
downloadqemu-cbd5979bb2ca8609ef19ebdfdc46043c46f0b42e.zip
qemu-cbd5979bb2ca8609ef19ebdfdc46043c46f0b42e.tar.gz
qemu-cbd5979bb2ca8609ef19ebdfdc46043c46f0b42e.tar.bz2
Merge remote-tracking branch 'sstabellini/disk_io' into staging
* sstabellini/disk_io: xen_disk: when using AIO flush after the operation is completed xen_disk: open disk with BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO
Diffstat (limited to 'hw/xen_disk.c')
-rw-r--r--hw/xen_disk.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index bf06fc1..9719395 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;
@@ -584,10 +584,10 @@ static int blk_init(struct XenDevice *xendev)
}
/* read-only ? */
+ qflags = BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO;
if (strcmp(blkdev->mode, "w") == 0) {
- qflags = BDRV_O_RDWR;
+ qflags |= BDRV_O_RDWR;
} else {
- qflags = 0;
info |= VDISK_READONLY;
}