From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9fKM-0001F5-Qn for qemu-devel@nongnu.org; Thu, 17 Dec 2015 15:39:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9fKJ-0000a0-LN for qemu-devel@nongnu.org; Thu, 17 Dec 2015 15:39:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43592) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9fKJ-0000Zu-DY for qemu-devel@nongnu.org; Thu, 17 Dec 2015 15:39:03 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id CE67C935D5 for ; Thu, 17 Dec 2015 20:39:02 +0000 (UTC) References: <1450371004-26866-1-git-send-email-armbru@redhat.com> <1450371004-26866-12-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <56731D65.9050703@redhat.com> Date: Thu, 17 Dec 2015 13:39:01 -0700 MIME-Version: 1.0 In-Reply-To: <1450371004-26866-12-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WMf3uINgnBuXTjgH0ogFcD6d6476wJEIg" Subject: Re: [Qemu-devel] [PATCH v2 11/23] 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) --WMf3uINgnBuXTjgH0ogFcD6d6476wJEIg Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/17/2015 09:49 AM, Markus Armbruster wrote: > Done with this Coccinelle semantic patch >=20 > @@ > expression FMT, E; > expression list ARGS; > @@ > - error_report(FMT, ARGS, error_get_pretty(E)); > + error_reportf_err(E, FMT/*@@@*/, ARGS); > ( > - error_free(E); > | > exit(S); Does S have to be declared an expression, for this branch to work correctly? I guess not, since... > | > 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. > Hey - you can already make it do more than I can. > 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: "); > exit(1); =2E..you properly found this spot. > +++ b/blockdev.c > @@ -1583,13 +1583,10 @@ static void internal_snapshot_abort(BlkActionSt= ate *common) > } > =20 > if (bdrv_snapshot_delete(bs, sn->id_str, sn->name, &local_error) <= 0) { > - error_report("Failed to delete snapshot with id '%s' and name = '%s' on " > - "device '%s' in abort: %s", > - sn->id_str, > - sn->name, > - bdrv_get_device_name(bs), > - error_get_pretty(local_error)); > - error_free(local_error); > + error_reportf_err(local_error, > + "Failed to delete snapshot with id '%s' and = name '%s' on " "device '%s' in abort: ", Whoops; line rewrapping touchups missed here. With that fixed, Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --WMf3uINgnBuXTjgH0ogFcD6d6476wJEIg 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/ iQEcBAEBCAAGBQJWcx1lAAoJEKeha0olJ0NqlYIH/REqxsc9N+bxZHAMvNKNLY4w DlxLFHoAAkEmMJOnBGwsubxUexaMXhzp6JoRL0f/E5cCmCwa8/Ux9OYU/3BfoUfT MPX5W6bWAiLggNNdgc3q8FvWtg9z71SHeTaQZq3cJs9fXpxxdgbbc/rR3EmlGUTM 7qJyKMuU8SWVtjgHzce0uQN+AHvp277VBp6BHIAPrGYNjbzh9JhgtiU4aR7xmN1e PiuyEeSbSre5B4KUKf2imoFFUlyP4htN3zCsw6tecqbFKT9LMYg0nnqipaXUIBMh npDQVqK6SwrhrmSp4CDdGj+9+6ci3UCD0IpiLgMHw3mj9+UbOKOC9Fe0q3fkNGU= =Sq8g -----END PGP SIGNATURE----- --WMf3uINgnBuXTjgH0ogFcD6d6476wJEIg--