From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uv3FT-0002w2-LZ for qemu-devel@nongnu.org; Fri, 05 Jul 2013 06:28:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uv3FS-00068v-OH for qemu-devel@nongnu.org; Fri, 05 Jul 2013 06:28:19 -0400 Sender: Paolo Bonzini Message-ID: <51D69FB5.3020400@redhat.com> Date: Fri, 05 Jul 2013 12:28:05 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1372862071-28225-1-git-send-email-pbonzini@redhat.com> <1372862071-28225-7-git-send-email-pbonzini@redhat.com> <20130705091950.GB11252@stefanha-thinkpad.redhat.com> In-Reply-To: <20130705091950.GB11252@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: Stefan Hajnoczi Cc: kwolf@redhat.com, pl@kamp.de, qemu-devel@nongnu.org, stefanha@redhat.com, qemu-stable@nongnu.org Il 05/07/2013 11:19, Stefan Hajnoczi ha scritto: > > /* 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 I think this is too specific. In the end, errors from bdrv_is_allocated are almost always due to a problem reading the metadata from the file. I will change it to "error reading image metadata", or something like that. (And also use strerror). Paolo