From patchwork Tue Apr 6 13:30:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 49518 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 976AAB7D0E for ; Tue, 6 Apr 2010 23:42:34 +1000 (EST) Received: from localhost ([127.0.0.1]:60391 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nz8xb-0004DG-9g for incoming@patchwork.ozlabs.org; Tue, 06 Apr 2010 09:36:55 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nz8ry-0002P9-2e for qemu-devel@nongnu.org; Tue, 06 Apr 2010 09:31:06 -0400 Received: from [140.186.70.92] (port=34545 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nz8ru-0002Lt-BP for qemu-devel@nongnu.org; Tue, 06 Apr 2010 09:31:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nz8rq-0006rK-MB for qemu-devel@nongnu.org; Tue, 06 Apr 2010 09:31:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28744) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nz8rq-0006qT-B1 for qemu-devel@nongnu.org; Tue, 06 Apr 2010 09:30:58 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o36DUsXg021658 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 6 Apr 2010 09:30:54 -0400 Received: from localhost.localdomain (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o36DUixI011039; Tue, 6 Apr 2010 09:30:49 -0400 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Tue, 6 Apr 2010 15:30:09 +0200 Message-Id: <1270560614-31030-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1270560614-31030-1-git-send-email-kwolf@redhat.com> References: <1270560614-31030-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com Subject: [Qemu-devel] [PATCH 1/6] qcow2: 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 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 5bea8f5..2f34eec 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -470,8 +470,10 @@ static void qcow_aio_read_cb(void *opaque, int ret) (acb->cluster_offset >> 9) + index_in_cluster, &acb->hd_qiov, acb->cur_nr_sectors, qcow_aio_read_cb, acb); - if (acb->hd_aiocb == NULL) + if (acb->hd_aiocb == NULL) { + ret = -EIO; goto done; + } } return; @@ -624,8 +626,10 @@ static void qcow_aio_write_cb(void *opaque, int ret) (acb->cluster_offset >> 9) + index_in_cluster, &acb->hd_qiov, acb->cur_nr_sectors, qcow_aio_write_cb, acb); - if (acb->hd_aiocb == NULL) + if (acb->hd_aiocb == NULL) { + ret = -EIO; goto done; + } return;