Skip to contentSkip to conversation

virtio-blk: Pass read errors to the guest

PATCH New Kevin Wolf 1 participant 1 message Nov 5, 2009

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 virtio-blk: Pass read errors to the guest

We need to signal not only write errors, but also read errors to the guest driver. This fixes a regression introduced by 869a5c6d.

---
 hw/virtio-blk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/virtio-blk.c +1 -1
index 2630b99..dd196df 100644
@@ -127,7 +127,7 @@ static void virtio_blk_rw_complete(void *opaque, int ret)
             return;
     }
 
-    virtio_blk_req_complete(req, VIRTIO_BLK_S_OK);
+    virtio_blk_req_complete(req, ret ? VIRTIO_BLK_S_IOERR : VIRTIO_BLK_S_OK);
 }
 
 static void virtio_blk_flush_complete(void *opaque, int ret)
Signature · 1 line
1.6.2.5