From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O0AoJ-0004Qu-4d for qemu-devel@nongnu.org; Fri, 09 Apr 2010 05:47:35 -0400 Received: from [140.186.70.92] (port=44359 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0AoG-0004OU-Ki for qemu-devel@nongnu.org; Fri, 09 Apr 2010 05:47:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O0AoE-0005zY-Hb for qemu-devel@nongnu.org; Fri, 09 Apr 2010 05:47:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62705) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0AoD-0005zO-VI for qemu-devel@nongnu.org; Fri, 09 Apr 2010 05:47:30 -0400 From: Kevin Wolf Date: Fri, 9 Apr 2010 11:46:27 +0200 Message-Id: <1270806388-28138-10-git-send-email-kwolf@redhat.com> In-Reply-To: <1270806388-28138-1-git-send-email-kwolf@redhat.com> References: <1270806388-28138-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [STABLE][PATCH 09/10] qcow2: Don't ignore immediate read/write failures List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: aurelien@aurel32.net Cc: kwolf@redhat.com, qemu-devel@nongnu.org Returning -EIO is far from optimal, but at least it's an error code. Signed-off-by: Kevin Wolf --- block/qcow2.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 4ae8f19..f6f8980 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -467,8 +467,10 @@ static void qcow_aio_read_cb(void *opaque, int ret) acb->hd_aiocb = bdrv_aio_readv(s->hd, (acb->cluster_offset >> 9) + index_in_cluster, &acb->hd_qiov, acb->n, qcow_aio_read_cb, acb); - if (acb->hd_aiocb == NULL) + if (acb->hd_aiocb == NULL) { + ret = -EIO; goto done; + } } return; @@ -620,8 +622,10 @@ static void qcow_aio_write_cb(void *opaque, int ret) (acb->cluster_offset >> 9) + index_in_cluster, &acb->hd_qiov, acb->n, qcow_aio_write_cb, acb); - if (acb->hd_aiocb == NULL) + if (acb->hd_aiocb == NULL) { + ret = -EIO; goto done; + } return; -- 1.6.6.1