]> git.proxmox.com Git - qemu.git/commitdiff
virtio-blk: Respect werror option for flushes
authorKevin Wolf <kwolf@redhat.com>
Wed, 20 Oct 2010 11:17:30 +0000 (13:17 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 22 Oct 2010 12:49:35 +0000 (14:49 +0200)
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

index a1df26dbcf311490a66ddcc8aa198a0033953797..dbe207070e11dc5aded47563fec5b30f87ae61c2 100644 (file)
@@ -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)