From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UV2ni-0007u1-JI for qemu-devel@nongnu.org; Wed, 24 Apr 2013 12:44:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UV2ng-00052D-7d for qemu-devel@nongnu.org; Wed, 24 Apr 2013 12:44:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UV2nf-00051r-Tb for qemu-devel@nongnu.org; Wed, 24 Apr 2013 12:44:08 -0400 Message-ID: <51780BD3.6000004@redhat.com> Date: Wed, 24 Apr 2013 10:44:03 -0600 From: Eric Blake MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2PWEVPNCQHFDMDOFSRRWV" Subject: Re: [Qemu-devel] [PATCH v2 01/12] qemu-img: introduce qemu_img_handle_error() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Hrdina Cc: kwolf@redhat.com, xiawenc@linux.vnet.ibm.com, lcapitulino@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2PWEVPNCQHFDMDOFSRRWV Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/24/2013 09:31 AM, Pavel Hrdina wrote: > Later in the patch series we will use this function a few times. > This will avoid duplicating the code. >=20 > Signed-off-by: Pavel Hrdina > --- > qemu-img.c | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) > =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; > + } > + return 0; Maybe it's just me, but I think returning EXIT_SUCCESS/EXIT_FAILURE instead of 0/1 is a bit nicer at expressing why we chose a positive value; but that would be a separate cleanup to all of qemu-img.c. Hence, I have no problems giving: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2PWEVPNCQHFDMDOFSRRWV 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/ iQEcBAEBCAAGBQJReAvTAAoJEKeha0olJ0Nq5nkH/31z+1ckCfvD3DaLG5lTFuKX jrVIAjw4Jnb+ahfTEk29UDDmqy4Ii2oEpaHcdd6dQGx2jdfsSlW80x5S94b3xtLJ F9JQHAQuAuSpOoHtKROe6quKKWqcupsAQnZe/VaY9h8gtKkUudQUd49dw8RVsVki 6vCGRW1mfOl1KaBum3LAunKlSHra5Ifg9eE/SXsOhYhPFUBfSi9Qv8RbKWW047W+ 7ob5v0CEIvTGhpDY8CkZf41vkdmBdD/vu+VBRBNi2WXbEXYvivxyCPFD8ADKFuuq Jmt1p3wI/4B1h1uAzazNnJAcppc2xfBuxqR0l6Vi/4w/NtPV7dA79nJLIC2qIUQ= =yIj8 -----END PGP SIGNATURE----- ------enig2PWEVPNCQHFDMDOFSRRWV--