From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDCzy-0003u7-Eq for qemu-devel@nongnu.org; Wed, 15 Jun 2016 11:44:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDCzx-0003tb-Bg for qemu-devel@nongnu.org; Wed, 15 Jun 2016 11:44:58 -0400 References: <20160615153630.2116-1-mreitz@redhat.com> <20160615153630.2116-2-mreitz@redhat.com> From: Eric Blake Message-ID: <576177F2.1020507@redhat.com> Date: Wed, 15 Jun 2016 09:44:50 -0600 MIME-Version: 1.0 In-Reply-To: <20160615153630.2116-2-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IoegOXmwoO9nS5wSMKO7XTpPbCAps5C8j" Subject: Re: [Qemu-devel] [PATCH 1/2] qemu-img: Use strerror() for generic resize error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-block@nongnu.org Cc: Kevin Wolf , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IoegOXmwoO9nS5wSMKO7XTpPbCAps5C8j Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/15/2016 09:36 AM, Max Reitz wrote: > Emitting the plain error number is not very helpful. Use strerror() > instead. >=20 > Signed-off-by: Max Reitz > --- > qemu-img.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/qemu-img.c b/qemu-img.c > index 14e2661..d5ccd9a 100644 > --- a/qemu-img.c > +++ b/qemu-img.c > @@ -3277,7 +3277,7 @@ static int img_resize(int argc, char **argv) > error_report("Image is read-only"); > break; > default: > - error_report("Error resizing image (%d)", -ret); > + error_report("Error resizing image: %s", strerror(-ret)); > break; I've argued in the past that we have lots of error_report() callers using strerror(), and may want to add an error_report_errno() (similar to error_setg_errno()); this just adds to the list of things that would benefit. But such a conversion would be a separate BiteSized task, and doesn't invalidate your patch. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --IoegOXmwoO9nS5wSMKO7XTpPbCAps5C8j Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXYXfyAAoJEKeha0olJ0NqxvkIAJa75NsH+deb3WEUjOADHJUv GajChtpohcH4sLasxG2/NJuc/BmzUq4dNVfxg2PN0g8syPuHuQHgDAr1QNoNGzpw ryXgmNJ3dH4DDcVOqtGHsRNLB55Rgii7sIwMveFOBsQ05sXDuvcyOG7FpdB/LJXC RQWEus+bBowcUpcxrt3HU3AfzZK71vSr0k28gruQNgVaUuBlnd3ta5Jhw7OUrhJ0 1UP8bq+w3hhHgDnrEIiTHhP0rNH60oPC3QYYMC1Gmz+45DA0vM/YYG+3y3Kq3sF/ 5pI0rMFhApxNchH6fpQFBv6n80QmBxQSerJfU2/2FX9A04ETn3JMPhm1vnAfUf0= =feSb -----END PGP SIGNATURE----- --IoegOXmwoO9nS5wSMKO7XTpPbCAps5C8j--