Skip to contentSkip to conversation

virtio-blk: Respect werror option for flushes

PATCH In review Kevin Wolf 2 participants 2 messages Oct 20, 2010 – Oct 21, 2010

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 virtio-blk: Respect werror option for flushes

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.

---
 hw/virtio-blk.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
hw/virtio-blk.c +7 -1
index a1df26d..dbe2070 100644
@@ -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)
Signature · 1 line
1.7.2.3
#1 lore raw
Quoted 2 lines · Kevin Wolf

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