]> git.proxmox.com Git - mirror_qemu.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>
Fri, 23 Mar 2012 14:34:16 +0000 (14:34 +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 0f265a4baacc1080cad0a789f77cf3c1d61473cf..9cb0253719c9b723651efb9a124218e473d6eadd 100644 (file)
@@ -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;