[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PULL 21/23] bsd-user: replace fprintf(s
Re: [Qemu-trivial] [Qemu-devel] [PULL 21/23] bsd-user: replace fprintf(stderr, ...) with error_report()
Mon, 02 Jun 2014 17:16:07 +0400
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0
02.06.2014 17:09, Markus Armbruster wrote:
> Peter Maydell <address@hidden> writes:
>> 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
> 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).
Please note the talk is about bsd-USER, not a SYSTEM emulation.
And for -user. the command line is usually just the opposite - very
short, consisting of the original command line with qemu-foo prepended.
When I encountered this phenomenon (lack of any #includes declaring
error_report()) I thought that maybe an alternative channel for error
reporting might be useful there, like QEMU_LOG=$TMPDIR/foo qemu-foo ...,
so that the output produced by qemu can be separated from the output
produced by the program it runs, but just as Peter pointed out, we're
far from there yet, and indeed, we should start elsewhere.