qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-devel@nongnu.org
Cc: hch@lst.de
Subject: [Qemu-devel] [PATCH 3/3] virtio-blk: Fix error cases which ignored rerror/werror
Date: Wed, 27 Jan 2010 13:12:36 +0100	[thread overview]
Message-ID: <1264594356-10375-4-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1264594356-10375-1-git-send-email-kwolf@redhat.com>

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>
---
 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 5a413b9..037a79c 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -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);
     }
 }
 
-- 
1.6.5.2

  parent reply	other threads:[~2010-01-27 12:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-27 12:12 [Qemu-devel] [PATCH 0/3] virtio-blk: rerror/werror fixes (including corruption fix) Kevin Wolf
2010-01-27 12:12 ` [Qemu-devel] [PATCH 1/3] virtio_blk: Factor virtio_blk_handle_request out Kevin Wolf
2010-01-27 18:20   ` [Qemu-devel] " Christoph Hellwig
2010-01-29 20:43   ` [Qemu-devel] " Anthony Liguori
2010-01-27 12:12 ` [Qemu-devel] [PATCH 2/3] virtio-blk: Fix restart after read error Kevin Wolf
2010-01-27 18:20   ` [Qemu-devel] " Christoph Hellwig
2010-01-27 12:12 ` Kevin Wolf [this message]
2010-01-27 18:21   ` [Qemu-devel] Re: [PATCH 3/3] virtio-blk: Fix error cases which ignored rerror/werror Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1264594356-10375-4-git-send-email-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=hch@lst.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).