From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eSTS8-0002oe-8l for qemu-devel@nongnu.org; Fri, 22 Dec 2017 14:57:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eSTS7-0001UW-FF for qemu-devel@nongnu.org; Fri, 22 Dec 2017 14:57:56 -0500 MIME-Version: 1.0 Sender: alistair23@gmail.com In-Reply-To: <1cfb1217-e32d-8e91-da46-07f1c72be77f@redhat.com> References: <6bad4084f4cbc290e2e9f1a72fcfcda7223383ec.1513790495.git.alistair.francis@xilinx.com> <87lghulqno.fsf@dusky.pond.sub.org> <1cfb1217-e32d-8e91-da46-07f1c72be77f@redhat.com> From: Alistair Francis Date: Fri, 22 Dec 2017 11:57:20 -0800 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] [PATCH v6 04/29] hw/arm: Replace fprintf(stderr, "*\n" with error_report() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: Markus Armbruster , Alistair Francis , QEMU Trivial , qemu-arm , "qemu-devel@nongnu.org Developers" , Peter Maydell On Fri, Dec 22, 2017 at 9:17 AM, Thomas Huth wrote: > On 22.12.2017 16:37, Markus Armbruster wrote: >> Second thoughts... >> >> Alistair Francis writes: > [...] >>> #include "qemu/osdep.h" >>> +#include "qemu/error-report.h" >>> #include "qapi/error.h" >>> #include "qemu-common.h" >>> #include "cpu.h" >>> @@ -1311,8 +1312,8 @@ static void omap_prcm_apll_update(struct omap_prcm_s *s) >>> /* TODO: update clocks */ >>> >>> if (mode[0] == 1 || mode[0] == 2 || mode[1] == 1 || mode[1] == 2) >>> - fprintf(stderr, "%s: bad EN_54M_PLL or bad EN_96M_PLL\n", >>> - __func__); >>> + error_report("%s: bad EN_54M_PLL or bad EN_96M_PLL", >>> + __func__); >>> } >> >> This one's different: we neither exit() nor return a "failed" status to >> the caller. >> >> We get here when the guest writes something funny to a certain >> memory-mapped I/O register. In other words, it's guest misbehavior, not >> a user error. I doubt it should be reported with error_report(). >> Peter, do we have a canonical way to report or log guest misbehavior? > > qemu_log_mask(LOG_GUEST_ERROR, ...) ? That seems like the best option to me. Alistair > > Thomas > >