From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULKnY-0006EX-W7 for qemu-devel@nongnu.org; Thu, 28 Mar 2013 17:55:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULKnX-0004Jn-Dw for qemu-devel@nongnu.org; Thu, 28 Mar 2013 17:55:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11261) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULKnX-0004JY-0C for qemu-devel@nongnu.org; Thu, 28 Mar 2013 17:55:51 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2SLtoGj005601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 28 Mar 2013 17:55:50 -0400 Message-ID: <5154BC65.4040105@redhat.com> Date: Thu, 28 Mar 2013 15:55:49 -0600 From: Eric Blake MIME-Version: 1.0 References: <624f54b5c269178e6fb4b212de05ceda59c3d009.1364487348.git.phrdina@redhat.com> <5154B92B.9030604@redhat.com> In-Reply-To: <5154B92B.9030604@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2KSROIVFCMEMDEUOTIUCQ" Subject: Re: [Qemu-devel] [PATCH v3 08/11] qemu-img: introduce qemu_img_handle_error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: armbru@redhat.com, Pavel Hrdina , qemu-devel@nongnu.org, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2KSROIVFCMEMDEUOTIUCQ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/28/2013 03:42 PM, Eric Blake wrote: > On 03/28/2013 10:47 AM, Pavel Hrdina wrote: >> Signed-off-by: Pavel Hrdina >> --- >> qemu-img.c | 18 ++++++++++++------ >> 1 file changed, 12 insertions(+), 6 deletions(-) >=20 > Reviewed-by: Eric Blake >=20 >> +static int qemu_img_handle_error(Error *err) >> +{ >> + if (error_is_set(&err)) { >> + error_report("%s", error_get_pretty(err)); >> + error_free(err); >> + return 1; >=20 > A non-bool positive number is unusual for errors (-1, or a true/false > scheme, tend to be more common)... >=20 >> - if (error_is_set(&local_err)) { >> - error_report("%s", error_get_pretty(local_err)); >> - error_free(local_err); >> - return 1; >=20 > ...but it is accurate code motion, so it doesn't impact my review. And in reading 9/11, I found out why it struck me as unusual. I usually spell it EXIT_FAILURE instead of 1, for a return status intended to be used in a final exit() or return from main(). But that's a pre-existing syndrome that affects much more of qemu-img.c, not worth changing here. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2KSROIVFCMEMDEUOTIUCQ 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/ iQEcBAEBCAAGBQJRVLxlAAoJEKeha0olJ0NquBYIAKQqe42AMkgZ6Y9R/6McJpce h4oVf05OEzuIsxmTwSKRYgK+2b7EvEH5jHRystOGvV2bgdsbyy+64UgShYcLHVOO cSXlAtQ2OCo11u+JFq+xY7FfIHjuAHIwSo+/ZFLj4cRmE9ojSc9qSWRfuAInsWvA 8sdUpudihkA3d/wX+/IBoRCJDqcRFpFyQanqH9tjqpB+O0RjyrmyfgaL73V/g9Z0 XnGV7k6hu/+xB+MMHVHGInMJwi6Zhj7I4ezaaHK1K/TtPxLenqFqIeGEnu5ottFO GffpD83bgTgfYhXy14zaaVsLHzmHAKoKcMo6YN/Bf821kCdX5aXOaURctp2yitg= =QkG+ -----END PGP SIGNATURE----- ------enig2KSROIVFCMEMDEUOTIUCQ--