aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/dma/xlnx_dpdma.c2
-rw-r--r--hw/net/fsl_etsec/etsec.c2
-rw-r--r--hw/sd/sd.c2
-rw-r--r--hw/usb/redirect.c2
-rw-r--r--include/qemu-common.h3
-rw-r--r--net/colo-compare.c12
-rw-r--r--net/net.c2
-rw-r--r--util/hexdump.c4
8 files changed, 16 insertions, 13 deletions
diff --git a/hw/dma/xlnx_dpdma.c b/hw/dma/xlnx_dpdma.c
index b40c897de2..d75a806942 100644
--- a/hw/dma/xlnx_dpdma.c
+++ b/hw/dma/xlnx_dpdma.c
@@ -388,7 +388,7 @@ static void xlnx_dpdma_dump_descriptor(DPDMADescriptor *desc)
{
if (DEBUG_DPDMA) {
qemu_log("DUMP DESCRIPTOR:\n");
- qemu_hexdump((char *)desc, stdout, "", sizeof(DPDMADescriptor));
+ qemu_hexdump(desc, stdout, "", sizeof(DPDMADescriptor));
}
}
diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c
index ad20b22cdd..5c40303f93 100644
--- a/hw/net/fsl_etsec/etsec.c
+++ b/hw/net/fsl_etsec/etsec.c
@@ -357,7 +357,7 @@ static ssize_t etsec_receive(NetClientState *nc,
#if defined(HEX_DUMP)
fprintf(stderr, "%s receive size:%zd\n", nc->name, size);
- qemu_hexdump((void *)buf, stderr, "", size);
+ qemu_hexdump(buf, stderr, "", size);
#endif
/* Flush is unnecessary as are already in receiving path */
etsec->need_flush = false;
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 483c4f1720..1c8f8529ea 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1785,7 +1785,7 @@ send_response:
}
#ifdef DEBUG_SD
- qemu_hexdump((const char *)response, stderr, "Response", rsplen);
+ qemu_hexdump(response, stderr, "Response", rsplen);
#endif
return rsplen;
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 417a60a2e6..09edb0d81c 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -240,7 +240,7 @@ static void usbredir_log_data(USBRedirDevice *dev, const char *desc,
if (dev->debug < usbredirparser_debug_data) {
return;
}
- qemu_hexdump((char *)data, stderr, desc, len);
+ qemu_hexdump(data, stderr, desc, len);
}
/*
diff --git a/include/qemu-common.h b/include/qemu-common.h
index bb9496bd80..6834883822 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -138,7 +138,8 @@ int os_parse_cmd_args(int index, const char *optarg);
* Hexdump a buffer to a file. An optional string prefix is added to every line
*/
-void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size);
+void qemu_hexdump(const void *bufptr, FILE *fp,
+ const char *prefix, size_t size);
/*
* helper to parse debug environment variables
diff --git a/net/colo-compare.c b/net/colo-compare.c
index 2c20de1537..550272b3ba 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -494,9 +494,9 @@ sec:
g_queue_push_head(&conn->secondary_list, spkt);
if (trace_event_get_state_backends(TRACE_COLO_COMPARE_MISCOMPARE)) {
- qemu_hexdump((char *)ppkt->data, stderr,
+ qemu_hexdump(ppkt->data, stderr,
"colo-compare ppkt", ppkt->size);
- qemu_hexdump((char *)spkt->data, stderr,
+ qemu_hexdump(spkt->data, stderr,
"colo-compare spkt", spkt->size);
}
@@ -535,9 +535,9 @@ static int colo_packet_compare_udp(Packet *spkt, Packet *ppkt)
trace_colo_compare_udp_miscompare("primary pkt size", ppkt->size);
trace_colo_compare_udp_miscompare("Secondary pkt size", spkt->size);
if (trace_event_get_state_backends(TRACE_COLO_COMPARE_MISCOMPARE)) {
- qemu_hexdump((char *)ppkt->data, stderr, "colo-compare pri pkt",
+ qemu_hexdump(ppkt->data, stderr, "colo-compare pri pkt",
ppkt->size);
- qemu_hexdump((char *)spkt->data, stderr, "colo-compare sec pkt",
+ qemu_hexdump(spkt->data, stderr, "colo-compare sec pkt",
spkt->size);
}
return -1;
@@ -578,9 +578,9 @@ static int colo_packet_compare_icmp(Packet *spkt, Packet *ppkt)
trace_colo_compare_icmp_miscompare("Secondary pkt size",
spkt->size);
if (trace_event_get_state_backends(TRACE_COLO_COMPARE_MISCOMPARE)) {
- qemu_hexdump((char *)ppkt->data, stderr, "colo-compare pri pkt",
+ qemu_hexdump(ppkt->data, stderr, "colo-compare pri pkt",
ppkt->size);
- qemu_hexdump((char *)spkt->data, stderr, "colo-compare sec pkt",
+ qemu_hexdump(spkt->data, stderr, "colo-compare sec pkt",
spkt->size);
}
return -1;
diff --git a/net/net.c b/net/net.c
index bbaedb3c7a..f3e5d533fd 100644
--- a/net/net.c
+++ b/net/net.c
@@ -636,7 +636,7 @@ static ssize_t qemu_send_packet_async_with_flags(NetClientState *sender,
#ifdef DEBUG_NET
printf("qemu_send_packet_async:\n");
- qemu_hexdump((const char *)buf, stdout, "net", size);
+ qemu_hexdump(buf, stdout, "net", size);
#endif
if (sender->link_down || !sender->peer) {
diff --git a/util/hexdump.c b/util/hexdump.c
index f879ff0ad6..053f05d416 100644
--- a/util/hexdump.c
+++ b/util/hexdump.c
@@ -16,8 +16,10 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
-void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size)
+void qemu_hexdump(const void *bufptr, FILE *fp,
+ const char *prefix, size_t size)
{
+ const char *buf = bufptr;
unsigned int b, len, i, c;
for (b = 0; b < size; b += 16) {