diff options
author | Kevin Wolf <kwolf@redhat.com> | 2010-01-27 13:12:36 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-01-29 10:21:29 -0600 |
commit | bb45bcc8dec3863c31a07ac576f031ef4c961c93 (patch) | |
tree | 3ecfc7389a0a88432965e69781aa04c41674d1c9 | |
parent | 096109c8049f2821f57561f4b24d7f51c6d53ddd (diff) |
virtio-blk: Fix error cases which ignored rerror/werror
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 <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 6c510fbf601fd8c6891b2f1d7165ceb82308a16f)
-rw-r--r-- | hw/virtio-blk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index 136e460621..2fd9b3fba7 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -272,7 +272,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); } } } @@ -316,7 +316,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); } } |