[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL v4 09/12] lm32_sys: print test result on stderr
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PULL v4 09/12] lm32_sys: print test result on stderr |
Date: |
Mon, 3 Feb 2014 22:59:13 +0000 |
On 3 February 2014 22:39, Michael Walle <address@hidden> 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 <address@hidden> wrote:
>>> > Do not use qemu_log().
>>> >
>>> > Signed-off-by: Michael Walle <address@hidden>
>>> > ---
>>> >
>>> > 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.
thanks
-- PMM