From: Stefano Stabellini Date: Fri, 23 Mar 2012 11:37:25 +0000 (+0000) Subject: xen_disk: when using AIO flush after the operation is completed X-Git-Tag: qemu-xen-4.2.0~27 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4db776322827f0930d53b9e162dc1c6600d918d0;p=qemu-upstream-4.2-testing.git xen_disk: when using AIO flush after the operation is completed If ioreq->postsync call bdrv_flush when the AIO operation is actually completed. Signed-off-by: Stefano Stabellini --- diff --git a/hw/xen_disk.c b/hw/xen_disk.c index 16c3e6692..e9bbbf785 100644 --- a/hw/xen_disk.c +++ b/hw/xen_disk.c @@ -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;