Skip to contentSkip to conversation

xen_disk: use bdrv_aio_flush instead of bdrv_flush

PATCH Superseded Stefano Stabellini 1 participant 1 message Apr 13, 2012

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen_disk: use bdrv_aio_flush instead of bdrv_flush

---
 hw/xen_disk.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
hw/xen_disk.c +6 -7
index 84ca76e..3e4a47b 100644
@@ -324,9 +324,6 @@ 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);
@@ -343,9 +340,9 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq)
         goto err_no_map;
     }
 
-    ioreq->aio_inflight++;
     if (ioreq->presync) {
-        bdrv_flush(blkdev->bs); /* FIXME: aio_flush() ??? */
+        ioreq->aio_inflight++;
+        bdrv_aio_flush(ioreq->blkdev->bs, qemu_aio_complete, ioreq);
     }
 
     switch (ioreq->req.operation) {
@@ -372,8 +369,10 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq)
         /* unknown operation (shouldn't happen -- parse catches this) */
         goto err;
     }
-
-    qemu_aio_complete(ioreq, 0);
+    if (ioreq->postsync) {
+        ioreq->aio_inflight++;
+        bdrv_aio_flush(ioreq->blkdev->bs, qemu_aio_complete, ioreq);
+    }
 
     return 0;
 
Signature · 1 line
1.7.2.5