qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL 21/23] bsd-user: replace fprintf(stderr, ...) wit


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PULL 21/23] bsd-user: replace fprintf(stderr, ...) with error_report()
Date: Mon, 02 Jun 2014 15:09:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Peter Maydell <address@hidden> writes:

> On 26 May 2014 08:20, Michael Tokarev <address@hidden> wrote:
>> From: Le Tan <address@hidden>
>>
>> Replace fprintf(stderr,...) with error_report() in files bsd-user/*.
>> The trailing "\n"s of the @fmt argument have been removed
>> because @fmt of error_report() should not contain newline.
>>
>> Signed-off-by: Le Tan <address@hidden>
>> Signed-off-by: Michael Tokarev <address@hidden>
>
> Was this patch tested? Building on FreeBSD the compiler
> complains:
> "warning: implicit declaration of function 'error_report' is invalid in C99"
>
> because none of these bsd-user files include a header which
> gives a prototype for error_report. Also, these are just
> straightforward reporting of command line errors, and I
> think that, like the linux-user code, we should handle
> these in the obvious way by printing to stderr. There's no
> need to drag in the error-handling framework for this,
> especially since user-mode doesn't have the "maybe we
> need to send this to the monitor" issues system emulation
> does.

Not much of a "framework", really.

Even in straightforward command line cases, error_report() adds value,
namely a uniform error message format that includes the program name.

Its ability to point to the offending option is useful when the command
line gets long (and ours are prone to get really, really long).
Especially useful when -readconfig comes into play (config file
bisection is no fun).  Unfortunately, the location information can get
lost on its way from option parsing to option use, but that's just
carelessness on our part.

> In short, I think we need to revert this commit
> (1fba509527beb).

Not my bikeshed to paint; do what you think is best.



reply via email to

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