]> git.proxmox.com Git - mirror_qemu.git/commitdiff
virtio-blk: Pass read errors to the guest
authorKevin Wolf <kwolf@redhat.com>
Thu, 5 Nov 2009 12:08:59 +0000 (13:08 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 12 Nov 2009 17:23:55 +0000 (11:23 -0600)
We need to signal not only write errors, but also read errors to the guest
driver. This fixes a regression introduced by 869a5c6d.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/virtio-blk.c

index e6df9f2619da793c92b10a943bcc6465bf670a0e..42b766fa2c7a0dedb79d2dec4fd10b3fb143a2df 100644 (file)
@@ -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)