From: "Andreas Färber" <afaerber@suse.de>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>, qemu-devel@nongnu.org
Cc: edgar.iglesias@xilinx.com, kwolf@redhat.com, aliguori@amazon.com,
lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH build-fix v1 1/1] error: Don't use error_report() for assertion msgs.
Date: Wed, 15 Jan 2014 03:55:35 +0100 [thread overview]
Message-ID: <52D5F8A7.4090603@suse.de> (raw)
In-Reply-To: <402b5ae030b5d15cd5b612493de366789c73183a.1389747507.git.peter.crosthwaite@xilinx.com>
Am 15.01.2014 03:29, schrieb Peter Crosthwaite:
> Use fprintf(stderr instead. This removes dependency of libqemuutil.a
> on the monitor.
>
> 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...
>
> Fixes the build as reported by Kevin Wolf. Issue debugged and change
> suggested by Luiz Capitulino. Issue introduced by
> 5d24ee70bcbcf578614193526bcd5ed30a8eb16c.
>
> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> ---
>
> util/error.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> 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, const char *fmt, ...)
> err->err_class = err_class;
>
> if (errp == &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();
> }
>
> @@ -80,7 +80,7 @@ void error_set_errno(Error **errp, int os_errno, ErrorClass err_class,
> err->err_class = err_class;
>
> if (errp == &error_abort) {
> - error_report("%s", error_get_pretty(err));
> + fprintf(stderr, "%s", error_get_pretty(err));
> abort();
> }
>
> @@ -125,7 +125,7 @@ void error_set_win32(Error **errp, int win32_err, ErrorClass err_class,
> err->err_class = err_class;
>
> if (errp == &error_abort) {
> - error_report("%s", error_get_pretty(err));
> + fprintf(stderr, "%s", error_get_pretty(err));
> abort();
> }
>
> @@ -171,7 +171,7 @@ void error_free(Error *err)
> void error_propagate(Error **dst_err, Error *local_err)
> {
> if (local_err && dst_err == &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 = local_err;
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2014-01-15 2:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-15 2:29 [Qemu-devel] [PATCH build-fix v1 1/1] error: Don't use error_report() for assertion msgs Peter Crosthwaite
2014-01-15 2:55 ` Andreas Färber [this message]
2014-01-15 3:31 ` Peter Crosthwaite
2014-01-15 3:34 ` Peter Crosthwaite
2014-01-15 10:01 ` Markus Armbruster
2014-01-15 14:19 ` Luiz Capitulino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52D5F8A7.4090603@suse.de \
--to=afaerber@suse.de \
--cc=aliguori@amazon.com \
--cc=edgar.iglesias@xilinx.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=peter.crosthwaite@xilinx.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).