[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH v6 04/29] hw/arm: Replace fprintf
From: |
Alistair Francis |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH v6 04/29] hw/arm: Replace fprintf(stderr, "*\n" with error_report() |
Date: |
Fri, 22 Dec 2017 12:58:53 -0800 |
On Fri, Dec 22, 2017 at 12:30 PM, Markus Armbruster <address@hidden> wrote:
> Alistair Francis <address@hidden> writes:
>
>> On Fri, Dec 22, 2017 at 9:17 AM, Thomas Huth <address@hidden> wrote:
>>> On 22.12.2017 16:37, Markus Armbruster wrote:
>>>> Second thoughts...
>>>>
>>>> Alistair Francis <address@hidden> 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.
>
> Suggest:
>
> 1. Keep converting fatal errors (the ones that exit())
>
> 2. Keep converting recoverable errors (the ones that return failure)
>
> 3. You can leave the prints that are neither alone. You can also
> convert to logging or tracing, as appropriate, but that requires
> understanding the code.
>
> Makes sense?
Does this apply to new patches after this series or to this series as
well? The series is mostly just mechanical find/replace. I really
don't want to have to dig through every patch to figure out what to
change/not change.
Alistair
>
- [Qemu-trivial] [PATCH v6 00/29] Remove some of the fprintf(stderr, "*, Alistair Francis, 2017/12/20
- [Qemu-trivial] [PATCH v6 03/29] Fixes after renaming __FUNCTION__ to __func__, Alistair Francis, 2017/12/20
- [Qemu-trivial] [PATCH v6 01/29] audio: Replace AUDIO_FUNC with __func__, Alistair Francis, 2017/12/20
- [Qemu-trivial] [PATCH v6 04/29] hw/arm: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/12/20
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v6 04/29] hw/arm: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2017/12/22
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v6 04/29] hw/arm: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2017/12/22
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v6 04/29] hw/arm: Replace fprintf(stderr, "*\n" with error_report(), Thomas Huth, 2017/12/22
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v6 04/29] hw/arm: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/12/22
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v6 04/29] hw/arm: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2017/12/22
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v6 04/29] hw/arm: Replace fprintf(stderr, "*\n" with error_report(),
Alistair Francis <=
[Qemu-trivial] [PATCH v6 06/29] hw/gpio: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/12/20
[Qemu-trivial] [PATCH v6 05/29] hw/dma: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/12/20
[Qemu-trivial] [PATCH v6 07/29] hw/i2c: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/12/20
[Qemu-trivial] [PATCH v6 02/29] Replace all occurances of __FUNCTION__ with __func__, Alistair Francis, 2017/12/20
[Qemu-trivial] [PATCH v6 09/29] hw/ide: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/12/20
[Qemu-trivial] [PATCH v6 10/29] hw/intc: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/12/20
[Qemu-trivial] [PATCH v6 11/29] hw/ipmi: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/12/20
[Qemu-trivial] [PATCH v6 12/29] hw/isa: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/12/20
[Qemu-trivial] [PATCH v6 13/29] hw/lm32: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/12/20