From patchwork Wed Mar 16 10:47:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 87226 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 00B75B6FE3 for ; Wed, 16 Mar 2011 21:49:39 +1100 (EST) Received: from localhost ([127.0.0.1]:44320 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzoIK-0005tb-A7 for incoming@patchwork.ozlabs.org; Wed, 16 Mar 2011 06:49:36 -0400 Received: from [140.186.70.92] (port=49708 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzoEq-0004Zf-HZ for qemu-devel@nongnu.org; Wed, 16 Mar 2011 06:46:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzoEn-0002PT-Vn for qemu-devel@nongnu.org; Wed, 16 Mar 2011 06:46:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzoEn-0002PG-JT for qemu-devel@nongnu.org; Wed, 16 Mar 2011 06:45:57 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2GAjtqv002057 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 16 Mar 2011 06:45:56 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p2GAjrlQ019365; Wed, 16 Mar 2011 06:45:54 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Wed, 16 Mar 2011 11:47:53 +0100 Message-Id: <1300272481-8744-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1300272481-8744-1-git-send-email-kwolf@redhat.com> References: <1300272481-8744-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 1/9] block/vdi: Don't ignore immediate read/write failures 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 From: Stefan Weil This patch is similar to 171e3d6b9997c98a97d0c525867f7cd9b640cadd which fixed qcow2: Returning -EIO is far from optimal, but at least it's an error code. Cc: Kevin Wolf Signed-off-by: Stefan Weil Signed-off-by: Kevin Wolf --- block/vdi.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/block/vdi.c b/block/vdi.c index 116b25b..9054079 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -610,6 +610,7 @@ static void vdi_aio_read_cb(void *opaque, int ret) acb->hd_aiocb = bdrv_aio_readv(bs->file, offset, &acb->hd_qiov, n_sectors, vdi_aio_read_cb, acb); if (acb->hd_aiocb == NULL) { + ret = -EIO; goto done; } } @@ -673,6 +674,7 @@ static void vdi_aio_write_cb(void *opaque, int ret) acb->hd_aiocb = bdrv_aio_writev(bs->file, 0, &acb->hd_qiov, 1, vdi_aio_write_cb, acb); if (acb->hd_aiocb == NULL) { + ret = -EIO; goto done; } return; @@ -702,6 +704,7 @@ static void vdi_aio_write_cb(void *opaque, int ret) acb->hd_aiocb = bdrv_aio_writev(bs->file, offset, &acb->hd_qiov, n_sectors, vdi_aio_write_cb, acb); if (acb->hd_aiocb == NULL) { + ret = -EIO; goto done; } return; @@ -752,6 +755,7 @@ static void vdi_aio_write_cb(void *opaque, int ret) &acb->hd_qiov, s->block_sectors, vdi_aio_write_cb, acb); if (acb->hd_aiocb == NULL) { + ret = -EIO; goto done; } } else { @@ -764,6 +768,7 @@ static void vdi_aio_write_cb(void *opaque, int ret) acb->hd_aiocb = bdrv_aio_writev(bs->file, offset, &acb->hd_qiov, n_sectors, vdi_aio_write_cb, acb); if (acb->hd_aiocb == NULL) { + ret = -EIO; goto done; } }