qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio-blk: Respect werror option for flushes
@ 2010-10-20 15:23 Kevin Wolf
  2010-10-21  5:22 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Wolf @ 2010-10-20 15:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

The werror option now affects not only write requests, but also flush requests.
Previously, it was not possible to stop a VM on a failed flush.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 hw/virtio-blk.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index a1df26d..dbe2070 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -106,7 +106,13 @@ static void virtio_blk_flush_complete(void *opaque, int ret)
 {
     VirtIOBlockReq *req = opaque;
 
-    virtio_blk_req_complete(req, ret ? VIRTIO_BLK_S_IOERR : VIRTIO_BLK_S_OK);
+    if (ret) {
+        if (virtio_blk_handle_rw_error(req, -ret, 0)) {
+            return;
+        }
+    }
+
+    virtio_blk_req_complete(req, VIRTIO_BLK_S_OK);
 }
 
 static VirtIOBlockReq *virtio_blk_alloc_request(VirtIOBlock *s)
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-blk: Respect werror option for flushes
  2010-10-20 15:23 [Qemu-devel] [PATCH] virtio-blk: Respect werror option for flushes Kevin Wolf
@ 2010-10-21  5:22 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2010-10-21  5:22 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel

On Wed, Oct 20, 2010 at 05:23:52PM +0200, Kevin Wolf wrote:
> The werror option now affects not only write requests, but also flush requests.
> Previously, it was not possible to stop a VM on a failed flush.

ACK

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-21  5:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-20 15:23 [Qemu-devel] [PATCH] virtio-blk: Respect werror option for flushes Kevin Wolf
2010-10-21  5:22 ` Christoph Hellwig

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).