Received: from eggs.gnu.org ([2001:4830:134:3::10]:58164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrS66-0008D6-97 for qemu-devel@nongnu.org; Mon, 02 Jun 2014 09:16:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrS5x-0003Rn-0o for qemu-devel@nongnu.org; Mon, 02 Jun 2014 09:16:18 -0400 Message-ID: <538C7917.5010703@msgid.tls.msk.ru> Date: Mon, 02 Jun 2014 17:16:07 +0400 From: Michael Tokarev MIME-Version: 1.0 References: <1401088811-22923-1-git-send-email-mjt@msgid.tls.msk.ru> <1401088811-22923-22-git-send-email-mjt@msgid.tls.msk.ru> <87mwdv8nle.fsf@blackfin.pond.sub.org> In-Reply-To: <87mwdv8nle.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 21/23] bsd-user: replace fprintf(stderr, ...) with error_report() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , Peter Maydell Cc: QEMU Trivial , QEMU Developers , Le Tan 02.06.2014 17:09, Markus Armbruster wrote: > Peter Maydell 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 >> 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). 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. Thanks, /mjt