From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLSkc-000378-So for qemu-devel@nongnu.org; Tue, 19 Jan 2016 04:38:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLSkY-0008Nt-1R for qemu-devel@nongnu.org; Tue, 19 Jan 2016 04:38:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLSkX-0008NT-SM for qemu-devel@nongnu.org; Tue, 19 Jan 2016 04:38:53 -0500 References: <145286604004.29455.1509463776346981362.stgit@localhost> <145286604762.29455.8630766735054984295.stgit@localhost> <569D4A82.5000506@redhat.com> From: Thomas Huth Message-ID: <569E0422.8040806@redhat.com> Date: Tue, 19 Jan 2016 10:38:42 +0100 MIME-Version: 1.0 In-Reply-To: <569D4A82.5000506@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kMKpW2JM0Gw5qhXk6ANvgvIxaDKDQPvhB" Subject: Re: [Qemu-devel] [PATCH v3 ] doc: Introduce coding style for errors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , =?UTF-8?Q?Llu=c3=ads_Vilanova?= , qemu-devel@nongnu.org Cc: Stefan Hajnoczi , "Dr . David Alan Gilbert" , Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --kMKpW2JM0Gw5qhXk6ANvgvIxaDKDQPvhB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 18.01.2016 21:26, Eric Blake wrote: > On 01/15/2016 06:54 AM, Llu=C3=ADs Vilanova wrote: >> Gives some general guidelines for reporting errors in QEMU. >> >> Signed-off-by: Llu=C3=ADs Vilanova >> --- >> HACKING | 36 ++++++++++++++++++++++++++++++++++++ >> 1 file changed, 36 insertions(+) =2E.. >> +Functions in this header are used to accumulate error messages in an = 'Error' >> +object, which can be propagated up the call chain where it is finally= reported. >> + >> +In its simplest form, you can immediately report an error with: >> + >> + error_setg(&error_fatal, "Error with %s", "arguments"); >=20 > This paradigm doesn't appear anywhere in the current code base > (hw/ppc/spapr*.c has a few cases of error_setg(&error_abort), but > nothing directly passes error_fatal). It's a bit odd to document > something that isn't actually used. +1 for _not_ documenting this here: IMHO this looks ugly. If we want something like this, I think we should introduce a proper error_report_fatal() function instead. Thomas --kMKpW2JM0Gw5qhXk6ANvgvIxaDKDQPvhB 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.0.22 (GNU/Linux) iQIcBAEBAgAGBQJWngQoAAoJEC7Z13T+cC21wVkQAIpkXa1FRtyVR+A5unrKqqs1 BhcIhe0+zSai+1HASbeZK4VT26exQ32m/Y78B2gQzJfjFESgt0FpPL7fTvsfaMD3 pFpDBTKKqIjecINAxwYWXnrMPRPLK9j62YYYK8OweabfJafumVZvpAnPvtuly65S 0Zv52b4yLhMMUC8lbPj6vv1+vKXCIz/SSWnKWrVGjBxrIZc1l7nB/BgSpTkUwu+M yZ1Pi/zk32Nht0KUbr4q74UYk2s3R2bNyxsOxpJeyCeh8IG15FWDYszxoQa2x83/ ak0VQdUJf4Fpz0HowwI+TCYRSKkCDWXh63ydCOHvQVNqCbrYmHfipaB3KgN7zKnX rwnkDxDTT37MYO1lvkOYIq62gtlzC1SBR1N8TZEFcdkHcqr0TRKjLKN2w9OI7F2j 5nZRD9auX2CKhzayi6hr6jcySFlTjvjXbSFfNTtPD6nIkHD/Gi397T4EFD+FQd+0 +SI4gW94NwEgrmNUlR5vQLpwHTzxW5x78U4GMCFO82A/2lpetHNKAxEuOWkqc6XT v61AirVxinqkHw+6IGZM5YXAFlEbSO/xkD2ySlLO/P14aO1OgGfcy0IRW+kBCvjW /xN5W080MZbzP9j9QbQ52+P51ypv5MZrBiojIFLkK1bGjjbwmdBzf0nYsCFMsvdI j8jRWDUlRWHixDxBpQSP =wmFU -----END PGP SIGNATURE----- --kMKpW2JM0Gw5qhXk6ANvgvIxaDKDQPvhB--