[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL v2 20/20] milkymist-minimac2: Use qemu_log_mask(GUEST
From: |
Laurent Vivier |
Subject: |
[Qemu-block] [PULL v2 20/20] milkymist-minimac2: Use qemu_log_mask(GUEST_ERROR) instead of error_report |
Date: |
Tue, 30 Oct 2018 12:23:37 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
qemu_log_mask(GUEST_ERROR) is more appropriate:
$ qemu -d help
Log items (comma separated):
guest_errors log when the guest OS does something invalid (eg accessing a
non-existent register)
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Acked-by: Michael Walle <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>
---
hw/net/milkymist-minimac2.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/hw/net/milkymist-minimac2.c b/hw/net/milkymist-minimac2.c
index 3eaa19dfde..664ac34f25 100644
--- a/hw/net/milkymist-minimac2.c
+++ b/hw/net/milkymist-minimac2.c
@@ -30,6 +30,7 @@
#include "hw/sysbus.h"
#include "trace.h"
#include "net/net.h"
+#include "qemu/log.h"
#include "qemu/error-report.h"
#include <zlib.h>
@@ -214,7 +215,8 @@ static size_t assemble_frame(uint8_t *buf, size_t size,
uint32_t crc;
if (size < payload_size + 12) {
- error_report("milkymist_minimac2: received too big ethernet frame");
+ qemu_log_mask(LOG_GUEST_ERROR, "milkymist_minimac2: frame too big "
+ "(%zd bytes)\n", payload_size);
return 0;
}
@@ -347,8 +349,9 @@ minimac2_read(void *opaque, hwaddr addr, unsigned size)
break;
default:
- error_report("milkymist_minimac2: read access to unknown register 0x"
- TARGET_FMT_plx, addr << 2);
+ qemu_log_mask(LOG_GUEST_ERROR,
+ "milkymist_minimac2_rd%d: 0x%" HWADDR_PRIx "\n",
+ size, addr << 2);
break;
}
@@ -413,8 +416,10 @@ minimac2_write(void *opaque, hwaddr addr, uint64_t value,
break;
default:
- error_report("milkymist_minimac2: write access to unknown register 0x"
- TARGET_FMT_plx, addr << 2);
+ qemu_log_mask(LOG_GUEST_ERROR,
+ "milkymist_minimac2_wr%d: 0x%" HWADDR_PRIx
+ " = 0x%" PRIx64 "\n",
+ size, addr << 2, value);
break;
}
}
--
2.17.2
- [Qemu-block] [PULL v2 19/20] ppc: move at24c to its own CONFIG_ symbol, (continued)
- [Qemu-block] [PULL v2 19/20] ppc: move at24c to its own CONFIG_ symbol, Laurent Vivier, 2018/10/30
- [Qemu-block] [PULL v2 10/20] linux-user: fix comment s/atomic_write/atomic_set/, Laurent Vivier, 2018/10/30
- [Qemu-block] [PULL v2 11/20] cpu.h: fix a typo in comment, Laurent Vivier, 2018/10/30
- [Qemu-block] [PULL v2 05/20] qemu-iotests: fix filename containing checks, Laurent Vivier, 2018/10/30
- [Qemu-block] [PULL v2 15/20] xen: Use the PCI_DEVICE macro, Laurent Vivier, 2018/10/30
- [Qemu-block] [PULL v2 03/20] memory.h: fix typos in comments, Laurent Vivier, 2018/10/30
- [Qemu-block] [PULL v2 18/20] hw/intc/gicv3: Remove useless parenthesis around DIV_ROUND_UP macro, Laurent Vivier, 2018/10/30
- [Qemu-block] [PULL v2 12/20] tests: Fix typos in comments and help message (found by codespell), Laurent Vivier, 2018/10/30
- [Qemu-block] [PULL v2 13/20] configure: Support pkg-config for zlib, Laurent Vivier, 2018/10/30
- [Qemu-block] [PULL v2 16/20] tests/bios-tables-test: Remove an useless cast, Laurent Vivier, 2018/10/30
- [Qemu-block] [PULL v2 20/20] milkymist-minimac2: Use qemu_log_mask(GUEST_ERROR) instead of error_report,
Laurent Vivier <=
- Re: [Qemu-block] [PULL v2 00/20] Qemu trivial for 3.1 patches, Peter Maydell, 2018/10/30