{
if (DEBUG_DPDMA) {
qemu_log("DUMP DESCRIPTOR:\n");
- qemu_hexdump(desc, stdout, "", sizeof(DPDMADescriptor));
+ qemu_hexdump(stdout, "", desc, sizeof(DPDMADescriptor));
}
}
#if defined(HEX_DUMP)
fprintf(stderr, "%s receive size:%zd\n", nc->name, size);
- qemu_hexdump(buf, stderr, "", size);
+ qemu_hexdump(stderr, "", buf, size);
#endif
/* Flush is unnecessary as are already in receiving path */
etsec->need_flush = false;
#if defined(HEX_DUMP)
qemu_log("eTSEC Send packet size:%d\n", etsec->tx_buffer_len);
- qemu_hexdump(etsec->tx_buffer, stderr, "", etsec->tx_buffer_len);
+ qemu_hexdump(stderr, "", etsec->tx_buffer, etsec->tx_buffer_len);
#endif /* ETSEC_RING_DEBUG */
if (etsec->first_bd.flags & BD_TX_TOEUN) {
}
#ifdef DEBUG_SD
- qemu_hexdump(response, stderr, "Response", rsplen);
+ qemu_hexdump(stderr, "Response", response, rsplen);
#endif
return rsplen;
if (dev->debug < usbredirparser_debug_data) {
return;
}
- qemu_hexdump(data, stderr, desc, len);
+ qemu_hexdump(stderr, desc, data, len);
}
/*
* Hexdump a buffer to a file. An optional string prefix is added to every line
*/
-void qemu_hexdump(const void *bufptr, FILE *fp,
- const char *prefix, size_t size);
+void qemu_hexdump(FILE *fp, const char *prefix,
+ const void *bufptr, size_t size);
/*
* helper to parse debug environment variables
g_queue_push_head(&conn->secondary_list, spkt);
if (trace_event_get_state_backends(TRACE_COLO_COMPARE_MISCOMPARE)) {
- qemu_hexdump(ppkt->data, stderr,
- "colo-compare ppkt", ppkt->size);
- qemu_hexdump(spkt->data, stderr,
- "colo-compare spkt", spkt->size);
+ qemu_hexdump(stderr, "colo-compare ppkt",
+ ppkt->data, ppkt->size);
+ qemu_hexdump(stderr, "colo-compare spkt",
+ spkt->data, spkt->size);
}
colo_compare_inconsistency_notify(s);
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(ppkt->data, stderr, "colo-compare pri pkt",
- ppkt->size);
- qemu_hexdump(spkt->data, stderr, "colo-compare sec pkt",
- spkt->size);
+ qemu_hexdump(stderr, "colo-compare pri pkt",
+ ppkt->data, ppkt->size);
+ qemu_hexdump(stderr, "colo-compare sec pkt",
+ spkt->data, spkt->size);
}
return -1;
} else {
trace_colo_compare_icmp_miscompare("Secondary pkt size",
spkt->size);
if (trace_event_get_state_backends(TRACE_COLO_COMPARE_MISCOMPARE)) {
- qemu_hexdump(ppkt->data, stderr, "colo-compare pri pkt",
- ppkt->size);
- qemu_hexdump(spkt->data, stderr, "colo-compare sec pkt",
- spkt->size);
+ qemu_hexdump(stderr, "colo-compare pri pkt",
+ ppkt->data, ppkt->size);
+ qemu_hexdump(stderr, "colo-compare sec pkt",
+ spkt->data, spkt->size);
}
return -1;
} else {
#ifdef DEBUG_NET
printf("qemu_send_packet_async:\n");
- qemu_hexdump(buf, stdout, "net", size);
+ qemu_hexdump(stdout, "net", buf, size);
#endif
if (sender->link_down || !sender->peer) {
#include "qemu/osdep.h"
#include "qemu-common.h"
-void qemu_hexdump(const void *bufptr, FILE *fp,
- const char *prefix, size_t size)
+void qemu_hexdump(FILE *fp, const char *prefix,
+ const void *bufptr, size_t size)
{
const char *buf = bufptr;
unsigned int b, len, i, c;
size = size > limit ? limit : size;
buf = g_malloc(size);
iov_to_buf(iov, iov_cnt, 0, buf, size);
- qemu_hexdump(buf, fp, prefix, size);
+ qemu_hexdump(fp, prefix, buf, size);
g_free(buf);
}