]> xenbits.xensource.com Git - qemu-upstream-4.2-testing.git/commitdiff
xen_disk: when using AIO flush after the operation is completed
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 23 Mar 2012 11:37:25 +0000 (11:37 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 11 Apr 2012 13:51:12 +0000 (13:51 +0000)
If ioreq->postsync call bdrv_flush when the AIO operation is actually
completed.

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

index 16c3e66921a774a4a6bffb777511fdece32fae1c..e9bbbf78511e1f01d6a6c8e86a086938c7e5d7ce 100644 (file)
@@ -398,6 +398,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);
@@ -444,9 +447,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;