From patchwork Wed Jan 27 12:12:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 43791 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 77E09B7CEF for ; Wed, 27 Jan 2010 23:22:42 +1100 (EST) Received: from localhost ([127.0.0.1]:38953 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Na6pE-0002Cm-7S for incoming@patchwork.ozlabs.org; Wed, 27 Jan 2010 07:16:48 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Na6mE-0001e5-Im for qemu-devel@nongnu.org; Wed, 27 Jan 2010 07:13:42 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Na6m9-0001c0-Cj for qemu-devel@nongnu.org; Wed, 27 Jan 2010 07:13:41 -0500 Received: from [199.232.76.173] (port=33605 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Na6m9-0001bw-7J for qemu-devel@nongnu.org; Wed, 27 Jan 2010 07:13:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55851) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Na6m8-0004uC-M6 for qemu-devel@nongnu.org; Wed, 27 Jan 2010 07:13:36 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0RCDYEs010992 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 27 Jan 2010 07:13:34 -0500 Received: from localhost.localdomain (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0RCDS42032340; Wed, 27 Jan 2010 07:13:33 -0500 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Wed, 27 Jan 2010 13:12:36 +0100 Message-Id: <1264594356-10375-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1264594356-10375-1-git-send-email-kwolf@redhat.com> References: <1264594356-10375-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: hch@lst.de Subject: [Qemu-devel] [PATCH 3/3] virtio-blk: Fix error cases which ignored rerror/werror X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Reviewed-by: Christoph Hellwig --- 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); } }