From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9xZq-0007YA-UK for qemu-devel@nongnu.org; Fri, 18 Dec 2015 11:08:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9xZm-0002OQ-9B for qemu-devel@nongnu.org; Fri, 18 Dec 2015 11:08:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9xZm-0002OI-3b for qemu-devel@nongnu.org; Fri, 18 Dec 2015 11:08:14 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id D94D5CE0 for ; Fri, 18 Dec 2015 16:08:13 +0000 (UTC) References: <1450452927-8346-1-git-send-email-armbru@redhat.com> <1450452927-8346-12-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <56742F6C.10408@redhat.com> Date: Fri, 18 Dec 2015 09:08:12 -0700 MIME-Version: 1.0 In-Reply-To: <1450452927-8346-12-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wfpLKQCQWg2e7dRAXKbfReaVs2Bs4h3DX" Subject: Re: [Qemu-devel] [PATCH v3 11/24] error: Use error_reportf_err() where it makes obvious sense List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wfpLKQCQWg2e7dRAXKbfReaVs2Bs4h3DX Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/18/2015 08:35 AM, Markus Armbruster wrote: > Done with this Coccinelle semantic patch >=20 > @@ > expression FMT, E, S; > expression list ARGS; > @@ > - error_report(FMT, ARGS, error_get_pretty(E)); > + error_reportf_err(E, FMT/*@@@*/, ARGS); > ( > - error_free(E); > | > exit(S); > | > abort(); > ) >=20 > followed by a replace of '%s"/*@@@*/' by '"' and some line rewrapping, > because I can't figure out how to make Coccinelle transform strings. >=20 > We now use the error whole instead of just its message obtained with > error_get_pretty(). This avoids suppressing its hint (see commit > 50b7b00), but I can't see how the errors touched in this commit could > come with hints. >=20 > Signed-off-by: Markus Armbruster > --- > +++ b/arch_init.c > @@ -258,9 +258,7 @@ void do_acpitable_option(const QemuOpts *opts) > =20 > acpi_table_add(opts, &err); > if (err) { > - error_report("Wrong acpi table provided: %s", > - error_get_pretty(err)); > - error_free(err); > + error_reportf_err(err, "Wrong acpi table provided: "); Bikeshedding: should error_reportf_err() automatically add the trailing ": " to the prefix, instead of having every caller express it? Would affect 10/24 as well. But I can't see a strong reason to add the churn it would cause for a respin, so I won't insist. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --wfpLKQCQWg2e7dRAXKbfReaVs2Bs4h3DX 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/ iQEcBAEBCAAGBQJWdC9tAAoJEKeha0olJ0NqRZcH/3JpYAax+NNYx3JB+u3TyC5J qLe42kzMTELIjfwPDMdo44RBaEzJHD8J3O1moTMzxBZ46CQHZkOAD6PyYLuqYQ9N vod5ESfdrkDA3uIOAjq4vtMQ7hXG8CopWjOr1uCyHuCqhPsBlWusyO7PxuUmj0f4 rNu00Cy5P/ohWMzd5MHtcrAVEX3BGW9YuIKFwtsiLeiGH5DL6LN+VPal0HzaRkbB E7LQF16PYpFJkEuXyNar4zYMtjqJeIZ2H4BhsqXZ9b+E0SPZ6qY+SJxChptiX6Jz 6r6HqKvSnxEduLWp0uZ3wkyhR+hOUk079fNYIylbmRDb/tlMslIVTOfQQGNpKt8= =lg9F -----END PGP SIGNATURE----- --wfpLKQCQWg2e7dRAXKbfReaVs2Bs4h3DX--