From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O5KrR-0007Xe-1i for qemu-devel@nongnu.org; Fri, 23 Apr 2010 11:32:09 -0400 Received: from [140.186.70.92] (port=50423 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O5KrO-0007Vi-6U for qemu-devel@nongnu.org; Fri, 23 Apr 2010 11:32:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O5KrH-0005uI-Np for qemu-devel@nongnu.org; Fri, 23 Apr 2010 11:32:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37209) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O5KrH-0005u9-7A for qemu-devel@nongnu.org; Fri, 23 Apr 2010 11:31:59 -0400 From: Kevin Wolf Date: Fri, 23 Apr 2010 17:30:44 +0200 Message-Id: <1272036658-26776-13-git-send-email-kwolf@redhat.com> In-Reply-To: <1272036658-26776-1-git-send-email-kwolf@redhat.com> References: <1272036658-26776-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 12/26] qcow2: Return 0/-errno in write_l2_entries List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: aliguori@linux.vnet.ibm.com Cc: kwolf@redhat.com, qemu-devel@nongnu.org Change write_l2_entries to return the real error code instead of -1. Signed-off-by: Kevin Wolf --- block/qcow2-cluster.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 8cb4b38..2f37acd 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@ -627,12 +627,13 @@ static int write_l2_entries(BDRVQcowState *s, uint64_t *l2_table, int start_offset = (8 * l2_index) & ~511; int end_offset = (8 * (l2_index + num) + 511) & ~511; size_t len = end_offset - start_offset; + int ret; BLKDBG_EVENT(s->hd, BLKDBG_L2_UPDATE); - if (bdrv_pwrite(s->hd, l2_offset + start_offset, &l2_table[l2_start_index], - len) != len) - { - return -1; + ret = bdrv_pwrite(s->hd, l2_offset + start_offset, + &l2_table[l2_start_index], len); + if (ret < 0) { + return ret; } return 0; -- 1.6.6.1