From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Peter Maydell" <peter.maydell@linaro.org>
Cc: qemu-trivial@nongnu.org, Jason Wang <jasowang@redhat.com>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH 10/11] hw/net/stellaris_enet: Use qemu_log_mask(GUEST_ERROR) instead of hw_error
Date: Fri, 22 Jun 2018 10:43:01 +0200 [thread overview]
Message-ID: <8b75e080-6c68-0bdc-1f2c-8ca6c0f80089@redhat.com> (raw)
In-Reply-To: <20180621180224.8312-11-f4bug@amsat.org>
On 21.06.2018 20:02, Philippe Mathieu-Daudé wrote:
> hw_error() finally calls abort(), but there is no need to abort here.
Additionally, hw_error() is also only meant for CPU errors (since it
dumps the CPU state). We should really rename that function to
"cpu_hw_error" one day to avoid that people use it in the wrong spots...
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> hw/net/stellaris_enet.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/hw/net/stellaris_enet.c b/hw/net/stellaris_enet.c
> index 04bd10ada3..188adcbd15 100644
> --- a/hw/net/stellaris_enet.c
> +++ b/hw/net/stellaris_enet.c
> @@ -9,6 +9,7 @@
> #include "qemu/osdep.h"
> #include "hw/sysbus.h"
> #include "net/net.h"
> +#include "qemu/log.h"
> #include <zlib.h>
>
> //#define DEBUG_STELLARIS_ENET 1
> @@ -343,7 +344,9 @@ static uint64_t stellaris_enet_read(void *opaque, hwaddr offset,
> case 0x3c: /* Undocuented: Timestamp? */
> return 0;
> default:
> - hw_error("stellaris_enet_read: Bad offset %x\n", (int)offset);
> + qemu_log_mask(LOG_GUEST_ERROR,
> + "stellaris_enet_rd%d: 0x%" HWADDR_PRIx "\n",
> + size, offset);
> return 0;
> }
> }
> @@ -442,7 +445,9 @@ static void stellaris_enet_write(void *opaque, hwaddr offset,
> /* Ignored. */
> break;
> default:
> - hw_error("stellaris_enet_write: Bad offset %x\n", (int)offset);
> + qemu_log_mask(LOG_GUEST_ERROR,
> + "stellaris_enet_wr%d: 0x%" HWADDR_PRIx " = 0x%lx\n",
> + size, offset, value);
> }
> }
Could you please keep the "bad offset" or a similar error message, so
that the user knows that there is really something wrong here?
Thomas
next prev parent reply other threads:[~2018-06-22 8:43 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-21 18:02 [Qemu-trivial] [PATCH 00/11] hw/arm: use qemu_log_mask instead of fprintf Philippe Mathieu-Daudé
2018-06-21 18:02 ` [Qemu-trivial] [PATCH 01/11] hw/input/pckbd: Use qemu_log_mask(GUEST_ERROR) " Philippe Mathieu-Daudé
2018-06-22 8:04 ` [Qemu-trivial] [Qemu-devel] " Thomas Huth
2018-06-22 13:19 ` Philippe Mathieu-Daudé
2018-06-21 18:02 ` [Qemu-trivial] [PATCH 02/11] hw/input/tsc2005: " Philippe Mathieu-Daudé
2018-06-21 18:02 ` [Qemu-trivial] [PATCH 03/11] hw/dma/omap_dma: Use qemu_log_mask(UNIMP) instead of printf Philippe Mathieu-Daudé
2018-06-22 8:11 ` [Qemu-trivial] [Qemu-devel] " Thomas Huth
2018-06-21 18:02 ` [Qemu-trivial] [PATCH 04/11] hw/dma/omap_dma: Use qemu_log_mask(GUEST_ERROR) instead of fprintf Philippe Mathieu-Daudé
2018-06-22 8:24 ` [Qemu-trivial] [Qemu-devel] " Thomas Huth
2018-06-22 13:23 ` Philippe Mathieu-Daudé
2018-06-21 18:02 ` [Qemu-trivial] [PATCH 05/11] hw/ssi/omap_spi: " Philippe Mathieu-Daudé
2018-06-21 18:04 ` [Qemu-trivial] [Qemu-devel] " Alistair Francis
2018-06-21 18:02 ` [Qemu-trivial] [PATCH 06/11] hw/sd/omap_mmc: Use qemu_log_mask(UNIMP) instead of printf Philippe Mathieu-Daudé
2018-06-22 8:26 ` [Qemu-trivial] [Qemu-devel] " Thomas Huth
2018-06-21 18:02 ` [Qemu-trivial] [PATCH 07/11] hw/i2c/omap_i2c: Use qemu_log_mask(UNIMP) instead of fprintf Philippe Mathieu-Daudé
2018-06-22 8:29 ` [Qemu-trivial] [Qemu-devel] " Thomas Huth
2018-06-21 18:02 ` [Qemu-trivial] [PATCH 08/11] hw/arm/omap: Use qemu_log_mask(GUEST_ERROR) " Philippe Mathieu-Daudé
2018-06-22 8:34 ` [Qemu-trivial] [Qemu-devel] " Thomas Huth
2018-06-22 13:23 ` Philippe Mathieu-Daudé
2018-06-21 18:02 ` [Qemu-trivial] [PATCH 09/11] hw/arm/stellaris: Use qemu_log_mask(UNIMP) " Philippe Mathieu-Daudé
2018-06-22 8:36 ` [Qemu-trivial] [Qemu-devel] " Thomas Huth
2018-06-21 18:02 ` [Qemu-trivial] [PATCH 10/11] hw/net/stellaris_enet: Use qemu_log_mask(GUEST_ERROR) instead of hw_error Philippe Mathieu-Daudé
2018-06-22 8:43 ` Thomas Huth [this message]
2018-06-22 13:24 ` [Qemu-trivial] [Qemu-devel] " Philippe Mathieu-Daudé
2018-06-21 18:02 ` [Qemu-trivial] [PATCH 11/11] hw/net/smc91c111: " Philippe Mathieu-Daudé
2018-06-22 8:43 ` [Qemu-trivial] [Qemu-devel] " Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8b75e080-6c68-0bdc-1f2c-8ca6c0f80089@redhat.com \
--to=thuth@redhat.com \
--cc=f4bug@amsat.org \
--cc=jasowang@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).