From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: Ian.Jackson@eu.citrix.com,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH 2/3] xen_disk: use bdrv_aio_flush instead of bdrv_flush
Date: Tue, 24 Apr 2012 14:08:48 +0100 [thread overview]
Message-ID: <1335272929-22967-2-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1204241404180.26786@kaball-desktop>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
hw/xen_disk.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index f9ef062..900f456 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -382,8 +382,6 @@ static void qemu_aio_complete(void *opaque, int ret)
ioreq->aio_inflight--;
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);
@@ -398,9 +396,10 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq)
if (ioreq->req.nr_segments && ioreq_map(ioreq) == -1)
goto err;
- ioreq->aio_inflight++;
- if (ioreq->presync)
- bdrv_flush(blkdev->bs); /* FIXME: aio_flush() ??? */
+ if (ioreq->presync) {
+ ioreq->aio_inflight++;
+ bdrv_aio_flush(ioreq->blkdev->bs, qemu_aio_complete, ioreq);
+ }
switch (ioreq->req.operation) {
case BLKIF_OP_READ:
@@ -422,8 +421,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;
--
1.7.2.5
next prev parent reply other threads:[~2012-04-24 13:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-24 13:07 [PATCH 0/3] qemu-xen-traditional: xen_disk backports Stefano Stabellini
2012-04-24 13:08 ` [PATCH 1/3] xen: handle backend deletion from xenstore Stefano Stabellini
2012-04-24 13:08 ` Stefano Stabellini [this message]
2012-04-24 13:08 ` [PATCH 3/3] xen_disk: implement BLKIF_OP_FLUSH_DISKCACHE, remove BLKIF_OP_WRITE_BARRIER Stefano Stabellini
2012-04-24 15:53 ` [PATCH 0/3] qemu-xen-traditional: xen_disk backports Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1335272929-22967-2-git-send-email-stefano.stabellini@eu.citrix.com \
--to=stefano.stabellini@eu.citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).