From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uv2BJ-0007Qa-IJ for qemu-devel@nongnu.org; Fri, 05 Jul 2013 05:19:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uv2BI-0006ZU-Jr for qemu-devel@nongnu.org; Fri, 05 Jul 2013 05:19:57 -0400 Date: Fri, 5 Jul 2013 11:19:50 +0200 From: Stefan Hajnoczi Message-ID: <20130705091950.GB11252@stefanha-thinkpad.redhat.com> References: <1372862071-28225-1-git-send-email-pbonzini@redhat.com> <1372862071-28225-7-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1372862071-28225-7-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH 06/17] block: expect errors from bdrv_co_is_allocated List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, pl@kamp.de, qemu-devel@nongnu.org, stefanha@redhat.com, qemu-stable@nongnu.org On Wed, Jul 03, 2013 at 04:34:20PM +0200, Paolo Bonzini wrote: > diff --git a/qemu-img.c b/qemu-img.c > index f8c97d3..857e2ca 100644 > --- a/qemu-img.c > +++ b/qemu-img.c > @@ -2073,6 +2073,10 @@ static int img_rebase(int argc, char **argv) > > /* If the cluster is allocated, we don't need to take action */ > ret = bdrv_is_allocated(bs, sector, n, &n); > + if (ret < 0) { > + error_report("error while reading from file"); > + goto out; > + } We should print the errno valid and saying "while reading from file" is a little misleading: "error while checking cluster allocation status: %d", ret