From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3Gdy-0001OB-WA for qemu-devel@nongnu.org; Tue, 14 Jan 2014 21:55:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3Gdq-0003f3-2z for qemu-devel@nongnu.org; Tue, 14 Jan 2014 21:55:50 -0500 Received: from cantor2.suse.de ([195.135.220.15]:50155 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3Gdp-0003ez-Sx for qemu-devel@nongnu.org; Tue, 14 Jan 2014 21:55:42 -0500 Message-ID: <52D5F8A7.4090603@suse.de> Date: Wed, 15 Jan 2014 03:55:35 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <402b5ae030b5d15cd5b612493de366789c73183a.1389747507.git.peter.crosthwaite@xilinx.com> In-Reply-To: <402b5ae030b5d15cd5b612493de366789c73183a.1389747507.git.peter.crosthwaite@xilinx.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH build-fix v1 1/1] error: Don't use error_report() for assertion msgs. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite , qemu-devel@nongnu.org Cc: edgar.iglesias@xilinx.com, kwolf@redhat.com, aliguori@amazon.com, lcapitulino@redhat.com Am 15.01.2014 03:29, schrieb Peter Crosthwaite: > Use fprintf(stderr instead. This removes dependency of libqemuutil.a > on the monitor. >=20 > We can further justify this change, in that this code path should only > trigger under a fatal error condition. fprintf-stderr is probably the > appropriate medium as under a fatal error conidition the monitor itself > may be down and out for the count. So assertion failure messages should > go lowest common denominator - straight to stderr. Actually I thought the point of error_report() was to add an appropriate prefix "qemu-system-foo: ..." to the error message and an optional timestamp, not to send it to the monitor... >=20 > Fixes the build as reported by Kevin Wolf. Issue debugged and change > suggested by Luiz Capitulino. Issue introduced by > 5d24ee70bcbcf578614193526bcd5ed30a8eb16c. >=20 > Signed-off-by: Peter Crosthwaite > --- >=20 > util/error.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/util/error.c b/util/error.c > index f11f1d5..7c7650c 100644 > --- a/util/error.c > +++ b/util/error.c > @@ -44,7 +44,7 @@ void error_set(Error **errp, ErrorClass err_class, co= nst char *fmt, ...) > err->err_class =3D err_class; > =20 > if (errp =3D=3D &error_abort) { > - error_report("%s", error_get_pretty(err)); > + fprintf(stderr, "%s", error_get_pretty(err)); You need to add \n if you do this. Andreas > abort(); > } > =20 > @@ -80,7 +80,7 @@ void error_set_errno(Error **errp, int os_errno, Erro= rClass err_class, > err->err_class =3D err_class; > =20 > if (errp =3D=3D &error_abort) { > - error_report("%s", error_get_pretty(err)); > + fprintf(stderr, "%s", error_get_pretty(err)); > abort(); > } > =20 > @@ -125,7 +125,7 @@ void error_set_win32(Error **errp, int win32_err, E= rrorClass err_class, > err->err_class =3D err_class; > =20 > if (errp =3D=3D &error_abort) { > - error_report("%s", error_get_pretty(err)); > + fprintf(stderr, "%s", error_get_pretty(err)); > abort(); > } > =20 > @@ -171,7 +171,7 @@ void error_free(Error *err) > void error_propagate(Error **dst_err, Error *local_err) > { > if (local_err && dst_err =3D=3D &error_abort) { > - error_report("%s", error_get_pretty(local_err)); > + fprintf(stderr, "%s", error_get_pretty(local_err)); > abort(); > } else if (dst_err && !*dst_err) { > *dst_err =3D local_err; >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg