From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9cwy-0002o2-OI for qemu-devel@nongnu.org; Thu, 17 Dec 2015 13:06:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9cwv-0003YD-Ii for qemu-devel@nongnu.org; Thu, 17 Dec 2015 13:06:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44993) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9cwv-0003Y7-EN for qemu-devel@nongnu.org; Thu, 17 Dec 2015 13:06:45 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 2C845C0B7E39 for ; Thu, 17 Dec 2015 18:06:45 +0000 (UTC) References: <1450371004-26866-1-git-send-email-armbru@redhat.com> <1450371004-26866-4-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <5672F9B0.6020907@redhat.com> Date: Thu, 17 Dec 2015 11:06:40 -0700 MIME-Version: 1.0 In-Reply-To: <1450371004-26866-4-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oLoA7ikCPgUdd5jNBUEp2ibwhcUKXtuCR" Subject: Re: [Qemu-devel] [PATCH v2 03/23] error: Use error_report_err() instead of monitor_printf() 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) --oLoA7ikCPgUdd5jNBUEp2ibwhcUKXtuCR Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/17/2015 09:49 AM, Markus Armbruster wrote: > Using error_report_err() instead of monitor_printf() makes no > difference when monitor_printf() is used correctly, i.e. within an HMP > monitor. Elsewhere, monitor_printf() does nothing, while > error_report_err() reports to stderr. >=20 > Most changed functions are HMP command handlers. These should only > run within an HMP monitor. The one exception is bdrv_password_cb(), > which should also only run within an HMP monitor. >=20 > Four command handlers prefix the error message with the command name: > balloon, migrate_set_capability, migrate_set_parameter, migrate. > Pointless, drop. >=20 > Coccinelle semantic patch: >=20 > @@ > expression M, E; > @@ > - monitor_printf(M, "%s\n", error_get_pretty(E)); > - error_free(E); > + error_report_err(E); > @r1@ > expression M, E; > format F; > position p; > @@ > - monitor_printf(M, "...%@F@\n", error_get_pretty(E));@p > - error_free(E); > + error_report_err(E); > @script:python@ > p << r1.p; > @@ > print "%s:%s:%s: prefix dropped" % (p[0].file, p[0].line, p[0].colu= mn) >=20 > Signed-off-by: Markus Armbruster > --- > hmp.c | 29 +++++++++-------------------- > hw/s390x/s390-skeys.c | 3 +-- > migration/savevm.c | 3 +-- > monitor.c | 6 ++---- > 4 files changed, 13 insertions(+), 28 deletions(-) Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --oLoA7ikCPgUdd5jNBUEp2ibwhcUKXtuCR 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/ iQEcBAEBCAAGBQJWcvmwAAoJEKeha0olJ0NqhAIH/j4PsTBdny64HYXGaX52iHBr jks0ezuui9dQGZoSs54bi5WgsW2T7PhgNxUMAd7AZdIo1WyKvuaO51DzS/GLLpe2 gZFHASIitdDUToDE8R9Zlj6lufUnseWKeQcrBbG9cLJ4y0wFiKKJPdujWUk1E4l1 kghdsGeOfEZPXLhdyhF/Wm8HlzcfH4Hbh2srgqdtsdaSoV2M3482hVczmtmcGu/k 8yT7B3aAWcarIBt1aeSLwzPRzwUa+rRQIQcqDhDzz8VpmVDcpzCYiCOKjCyNr/oq Dg/kfjMf4BaCsd4KLu9J0JbGR9k3bsg7VzX1EJiobwVdUtYfAzNMAGQ3T1P78Bs= =fggc -----END PGP SIGNATURE----- --oLoA7ikCPgUdd5jNBUEp2ibwhcUKXtuCR--