From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43021 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJSc0-0004oe-Lr for qemu-devel@nongnu.org; Tue, 01 Jun 2010 10:38:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJSbz-0007LY-0j for qemu-devel@nongnu.org; Tue, 01 Jun 2010 10:38:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48953) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJSby-0007LE-Oi for qemu-devel@nongnu.org; Tue, 01 Jun 2010 10:38:34 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o51EcXdl008847 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 1 Jun 2010 10:38:33 -0400 Message-ID: <4C051B58.7050406@redhat.com> Date: Tue, 01 Jun 2010 16:38:16 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1275401486-10848-1-git-send-email-quintela@redhat.com> In-Reply-To: <1275401486-10848-1-git-send-email-quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] propagate write_refcount_block_entries error List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org Am 01.06.2010 16:11, schrieb Juan Quintela: > Signed-off-by: Juan Quintela > --- > block/qcow2-refcount.c | 16 ++++++++-------- > 1 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c > index 744107c..4226dce 100644 > --- a/block/qcow2-refcount.c > +++ b/block/qcow2-refcount.c > @@ -460,10 +460,10 @@ static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs, > table_index = cluster_index >> (s->cluster_bits - REFCOUNT_SHIFT); > if ((old_table_index >= 0) && (table_index != old_table_index)) { > > - if (write_refcount_block_entries(bs, refcount_block_offset, > - first_index, last_index) < 0) > - { > - return -EIO; > + ret = write_refcount_block_entries(bs, refcount_block_offset, > + first_index, last_index); > + if (ret < 0) { > + return ret; > } > > first_index = -1; > @@ -505,10 +505,10 @@ fail: > > /* Write last changed block to disk */ > if (refcount_block_offset != 0) { > - if (write_refcount_block_entries(bs, refcount_block_offset, > - first_index, last_index) < 0) > - { > - return ret < 0 ? ret : -EIO; > + int write_ret = write_refcount_block_entries(bs, refcount_block_offset, > + first_index, last_index); > + if (write_ret < 0){ > + return ret < 0 ? ret : write_ret; > } > } > Something similar (but more complete) is already queued: http://repo.or.cz/w/qemu/kevin.git/commitdiff/b10200c1 Thanks anyway, the idea is the right one. :-) Kevin