From: Christoph Hellwig <hch@lst.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 4/5] ide: use bdrv_aio_flush
Date: Fri, 4 Sep 2009 19:02:06 +0200 [thread overview]
Message-ID: <20090904170206.GD22964@lst.de> (raw)
In-Reply-To: <20090904170052.GA22640@lst.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: qemu/hw/ide/core.c
===================================================================
--- qemu.orig/hw/ide/core.c 2009-09-04 13:43:56.306522749 -0300
+++ qemu/hw/ide/core.c 2009-09-04 13:52:43.814551074 -0300
@@ -771,6 +771,16 @@ static void ide_atapi_cmd_check_status(I
ide_set_irq(s->bus);
}
+static void ide_flush_cb(void *opaque, int ret)
+{
+ IDEState *s = opaque;
+
+ /* XXX: how do we signal I/O errors here? */
+
+ s->status = READY_STAT | SEEK_STAT;
+ ide_set_irq(s->bus);
+}
+
static inline void cpu_to_ube16(uint8_t *buf, int val)
{
buf[0] = val >> 8;
@@ -1969,9 +1979,9 @@ void ide_ioport_write(void *opaque, uint
case WIN_FLUSH_CACHE:
case WIN_FLUSH_CACHE_EXT:
if (s->bs)
- bdrv_flush(s->bs);
- s->status = READY_STAT | SEEK_STAT;
- ide_set_irq(s->bus);
+ bdrv_aio_flush(s->bs, ide_flush_cb, s);
+ else
+ ide_flush_cb(s, 0);
break;
case WIN_STANDBY:
case WIN_STANDBY2:
next prev parent reply other threads:[~2009-09-04 17:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-04 17:00 [Qemu-devel] [PATCH 0/5] data integrity fixes V2 Christoph Hellwig
2009-09-04 17:01 ` [Qemu-devel] [PATCH 1/5] block: add enable_write_cache flag Christoph Hellwig
2009-09-04 17:01 ` [Qemu-devel] [PATCH 2/5] block: use fdatasync instead of fsync if possible Christoph Hellwig
2009-09-04 17:01 ` [Qemu-devel] [PATCH 3/5] block: add aio_flush operation Christoph Hellwig
2009-09-04 17:02 ` Christoph Hellwig [this message]
2009-09-04 17:02 ` [Qemu-devel] [PATCH 5/5] virtio-blk: add volatile writecache feature Christoph Hellwig
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=20090904170206.GD22964@lst.de \
--to=hch@lst.de \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.