qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH build-fix v1 1/1] error: Don't use error_report(


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH build-fix v1 1/1] error: Don't use error_report() for assertion msgs.
Date: Wed, 15 Jan 2014 11:01:03 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Andreas Färber <address@hidden> writes:

> 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...

Exactly.  Unwanted loss of functionality.

Please try adding stubs/mon-set-error.o to whatever is missing cur_mon
instead.

>> 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 <address@hidden>
>> ---
>> 
>>  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.

Yup.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]