From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0AFA-00056P-Rr for qemu-devel@nongnu.org; Fri, 19 Jul 2013 08:57:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0AF9-0008Qb-JT for qemu-devel@nongnu.org; Fri, 19 Jul 2013 08:57:08 -0400 Message-ID: <51E9379C.1030001@redhat.com> Date: Fri, 19 Jul 2013 06:57:00 -0600 From: Eric Blake MIME-Version: 1.0 References: <1373992168-26043-1-git-send-email-pbonzini@redhat.com> <1373992168-26043-7-git-send-email-pbonzini@redhat.com> In-Reply-To: <1373992168-26043-7-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="secJdQA2BiLx9daaXLQAk12wm7xSQN5Ag" Subject: Re: [Qemu-devel] [PATCH v2 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: famz@redhat.com, pl@kamp.de, qemu-devel@nongnu.org, stefanha@redhat.com, qemu-stable@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --secJdQA2BiLx9daaXLQAk12wm7xSQN5Ag Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/16/2013 10:29 AM, Paolo Bonzini wrote: > Some bdrv_is_allocated callers do not expect errors, but the fallback > in qcow2.c might make other callers trip on assertion failures or > infinite loops. >=20 > Fix the callers to always look for errors. >=20 > Cc: qemu-stable@nongnu.org > Signed-off-by: Paolo Bonzini > --- > v1->v2: modify error message, add strerror(-ret) > +++ b/qemu-img.c > @@ -2073,6 +2073,11 @@ static int img_rebase(int argc, char **argv) > =20 > /* If the cluster is allocated, we don't need to take acti= on */ > ret =3D bdrv_is_allocated(bs, sector, n, &n); > + if (ret < 0) { > + error_report("error while reading image metadata: %s",= > + strerror(-ret)); Hmm, we have error_setg_errno so that callers don't have to use strerror(); is it time to introduce error_report_errno for the same convenience factor? But that's a side question that does not impact this patch. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --secJdQA2BiLx9daaXLQAk12wm7xSQN5Ag Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJR6TecAAoJEKeha0olJ0Nq/uYH/R0vYOfw2Xqbxvdb46lGMvyR 3icu849slIQFuZzy4TDBSnhQwSqPRlyYsy2KKedx1mI8a7SXwFHzBJussIG3d9bR zuKxYWyrOvB4axcbJ7l0SekUaS2AFCIeZgf5M8Xh7m1k0Qs+TdR8BaRAc/D5NEkZ +fEilgfk/vv4aeJymxdpwQtdPAz4SAqVOFxWY7qrqiJuVrujA75dQpf33yCxwCBk YcqxnX3/NWChDbhJWLM8PTCkeXhsqhQLBXJO2j4DLRA1VMTQRGfHNfsnSrRcBw4c rIrwpaSQ+LLqu5xKoowXtT6LyfFcCNqME6H0ljtuTpJmxcMMa5ryfRbAyd/PcSY= =eeq+ -----END PGP SIGNATURE----- --secJdQA2BiLx9daaXLQAk12wm7xSQN5Ag--