Received: from eggs.gnu.org ([2001:4830:134:3::10]:42862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAkUF-000576-EG for qemu-devel@nongnu.org; Tue, 04 Feb 2014 13:12:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAkUD-0007p6-IY for qemu-devel@nongnu.org; Tue, 04 Feb 2014 13:12:43 -0500 Received: from ssl.serverraum.org ([2a01:4f8:a0:1283::1:2]:39676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAkUD-0007oy-BX for qemu-devel@nongnu.org; Tue, 04 Feb 2014 13:12:41 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 04 Feb 2014 19:12:39 +0100 From: Michael Walle In-Reply-To: References: <1390246471-25167-1-git-send-email-michael@walle.cc> <1390246471-25167-10-git-send-email-michael@walle.cc> <201402012131.32819.michael@walle.cc> <873496d67ee6f46dad9eb53256ca3067@walle.cc> Message-ID: <9c9543413aa147359a1dae4f1d70da9d@walle.cc> Subject: Re: [Qemu-devel] =?utf-8?q?=5BPULL_v4_09/12=5D_lm32=5Fsys=3A_print_te?= =?utf-8?q?st_result_on_stderr?= List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Anthony Liguori Am 2014-02-03 23:59, schrieb Peter Maydell: > On 3 February 2014 22:39, Michael Walle wrote: >> Am 2014-02-01 21:31, schrieb Michael Walle: >> >>> Am Samstag, 1. Februar 2014, 19:00:01 schrieb Peter Maydell: >>>> >>>> On 20 January 2014 19:34, Michael Walle wrote: >>>> > Do not use qemu_log(). >>>> > >>>> > Signed-off-by: Michael Walle >>>> > --- >>>> > >>>> > hw/misc/lm32_sys.c | 2 +- >>>> > 1 file changed, 1 insertion(+), 1 deletion(-) >>>> > >>>> > diff --git a/hw/misc/lm32_sys.c b/hw/misc/lm32_sys.c >>>> > index 8176cdb..6af0cca 100644 >>>> > --- a/hw/misc/lm32_sys.c >>>> > +++ b/hw/misc/lm32_sys.c >>>> > @@ -80,7 +80,7 @@ static void sys_write(void *opaque, hwaddr addr, >>>> > >>>> > case R_PASSFAIL: >>>> > s->regs[addr] = value; >>>> > testname = (char *)s->testname; >>>> > >>>> > - qemu_log("TC %-32s %s\n", testname, (value) ? "FAILED" : >>>> > "OK"); >>>> > + fprintf(stderr, "TC %-32s %s\n", testname, (value) ? "FAILED" >>>> > : >>>> > "OK"); >>>> > >>>> > break; >>>> >>>> This looks wrong to me -- devices shouldn't print to stderr, >>>> ideally. >>> >>> >>> lm32_sys is actually no real device. it is just used for unit >>> testing. >>> >> >> Hi Peter, >> >> is this ok? or do you have some better idea? ideally, the lm32 target >> should >> use semihosting and should print to stdout/stderr itself. but that is >> not >> the case atm. > > Well, I guess for a testbench only kind of device printing to stderr is > OK. > > I've just noticed that the device maps itself into the memory map. > That's pretty foul. I can see why it does it, but really this thing is > bending a lot of the rules. So if it is ok, i'll leave this patch in this pull request. But i'll also work on the lm32 semihosting so we can get rid of this device entirely. -michael