]> Git Repo - qemu.git/commitdiff
virtio-blk: Fix error cases which ignored rerror/werror
authorKevin Wolf <[email protected]>
Wed, 27 Jan 2010 12:12:36 +0000 (13:12 +0100)
committerAnthony Liguori <[email protected]>
Fri, 29 Jan 2010 15:53:01 +0000 (09:53 -0600)
If an I/O request fails right away instead of getting an error only in the
callback, we still need to consider rerror/werror.

Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
hw/virtio-blk.c

index 5a413b94297d5991657e0ac1fa72c242c358bd65..037a79c5fffbf92e14afb5832399364028492e5a 100644 (file)
@@ -269,7 +269,7 @@ static void do_multiwrite(BlockDriverState *bs, BlockRequest *blkreq,
     if (ret != 0) {
         for (i = 0; i < num_writes; i++) {
             if (blkreq[i].error) {
-                virtio_blk_req_complete(blkreq[i].opaque, VIRTIO_BLK_S_IOERR);
+                virtio_blk_rw_complete(blkreq[i].opaque, -EIO);
             }
         }
     }
@@ -313,7 +313,7 @@ static void virtio_blk_handle_read(VirtIOBlockReq *req)
     acb = bdrv_aio_readv(req->dev->bs, req->out->sector, &req->qiov,
                          req->qiov.size / 512, virtio_blk_rw_complete, req);
     if (!acb) {
-        virtio_blk_req_complete(req, VIRTIO_BLK_S_IOERR);
+        virtio_blk_rw_complete(req, -EIO);
     }
 }
 
This page took 0.031863 seconds and 4 git commands to generate.