From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYXPt-0000mL-FZ for qemu-devel@nongnu.org; Tue, 22 Oct 2013 04:34:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VYXPp-00073j-3I for qemu-devel@nongnu.org; Tue, 22 Oct 2013 04:34:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYXPo-00073R-LA for qemu-devel@nongnu.org; Tue, 22 Oct 2013 04:34:12 -0400 Message-ID: <5266387D.1080506@redhat.com> Date: Tue, 22 Oct 2013 09:34:05 +0100 From: Eric Blake MIME-Version: 1.0 References: <1382430415-24844-1-git-send-email-pl@kamp.de> In-Reply-To: <1382430415-24844-1-git-send-email-pl@kamp.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1efOjkqf4CfEEFaUOp5SsotMkNm49bcTv" Subject: Re: [Qemu-devel] [PATCH] qemu-img: add special exit code if bdrv_check is not supported List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven , qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1efOjkqf4CfEEFaUOp5SsotMkNm49bcTv Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 10/22/2013 09:26 AM, Peter Lieven wrote: > currently it is not possible to distinguish by exitcode if there > has been an error or if bdrv_check is not supported by the image > format. Change the exitcode from 1 to 255 for the latter case. Why 255? Sure, 'xargs' handles $?=3D255 differently than most other status, but in general, $? > 128 starts to be ambiguous with death by signal (on the other hand, most systems stop at 64 signals rather than 128). Most applications that use differentiated exit status just use 1 and 2, rather than 1 and 255. >=20 > Signed-off-by: Peter Lieven > --- > qemu-img.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) But I don't care strongly enough to reject this, so if no one else complains about the choice: Reviewed-by: Eric Blake >=20 > diff --git a/qemu-img.c b/qemu-img.c > index 9fb3016..163aa3f 100644 > --- a/qemu-img.c > +++ b/qemu-img.c > @@ -609,7 +609,7 @@ static int img_check(int argc, char **argv) > if (output_format =3D=3D OFORMAT_HUMAN) { > error_report("This image format does not support checks");= > } > - ret =3D 1; > + ret =3D 255; > goto fail; > } > =20 >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --1efOjkqf4CfEEFaUOp5SsotMkNm49bcTv 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.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSZjh9AAoJEKeha0olJ0Nq9NkH/1zGo+7/ulhkOCyTBRs+CGtI vwrnptpnCfb5vpTZb/EalEKfpmXdOr+lGHRcliIwscqYhS2ALmbiagqOGmZQo9UE ptEonJIAgXdVAnBC6uIUKQcZ+RhZZ6Z5zLbrOJWoh6wC5+/qGWhgcDIvhWLWm86l eWhaVaubKEFWCssa229SX2Q8AVwg1a+58vcd/nvTlXwLc6UeI/G/V77pAd5nx/Qm moXXWoWDFJ87vroBUaAu/O099aUYzbEfPZnbITZ5vnj6bvORDXmDA81k6veSBtj1 Wg7Lm0vqMxX3m9Di6Ie39sROMQ/BhJEFGH8SI8wRRrfMVn4TaVSXa+dX8m0v1Sg= =leed -----END PGP SIGNATURE----- --1efOjkqf4CfEEFaUOp5SsotMkNm49bcTv--