util/hexdump: Cleanup qemu_hexdump()
v2 cover util/hexdump: Cleanup qemu_hexdump()
- Pass const void* buffer
- Reorder arguments
Supersedes: <[email protected]>
Philippe Mathieu-Daudé (2):
util/hexdump: Convert to take a void pointer argument util/hexdump: Reorder qemu_hexdump() arguments
include/qemu-common.h | 3 ++- hw/dma/xlnx_dpdma.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/net/fsl_etsec/rings.c | 2 +- hw/sd/sd.c | 2 +- hw/usb/redirect.c | 2 +- net/colo-compare.c | 24 ++++++++++++------------ net/net.c | 2 +- util/hexdump.c | 4 +++- util/iov.c | 2 +- 10 files changed, 24 insertions(+), 21 deletions(-)
Signature · 1 line
2.26.2
PATCH v2 1/2 util/hexdump: Convert to take a void pointer argument
Most uses of qemu_hexdump() do not take an array of char as input, forcing use of cast. Since we can use this helper to dump any kind of buffer, use a pointer to void argument instead.
---
Since v1:
- renamed argument 'bufptr' (Peter Maydell)
--- include/qemu-common.h | 3 ++- hw/dma/xlnx_dpdma.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/sd/sd.c | 2 +- hw/usb/redirect.c | 2 +- net/colo-compare.c | 12 ++++++------ net/net.c | 2 +- util/hexdump.c | 4 +++- 8 files changed, 16 insertions(+), 13 deletions(-)
include/qemu-common.h +2 -1
@@ -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
hw/dma/xlnx_dpdma.c +1 -1
@@ -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)); } }
hw/net/fsl_etsec/etsec.c +1 -1
@@ -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;
hw/sd/sd.c +1 -1
@@ -1781,7 +1781,7 @@ send_response: }#ifdef DEBUG_SD -qemu_hexdump ((const char *)response, stderr,"Response" , rsplen); +qemu_hexdump (response, stderr,"Response" , rsplen);#endif return rsplen;
hw/usb/redirect.c +1 -1
@@ -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); }/*
net/colo-compare.c +6 -6
@@ -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 ;
net/net.c +1 -1
@@ -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) {
util/hexdump.c +3 -1
@@ -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 ) {
Signature · 1 line
2.26.2
Re: [PATCH v2 1/2] util/hexdump: Convert to take a void pointer argument
Quoted 7 lines · Philippe Mathieu-Daudé
Most uses of
qemu_hexdump()do not take an array of char as input, forcing use of cast. Since we can use this helper to dump any kind of buffer, use a pointer to void argument instead.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Alistair
Quoted 153 lines
---
Since v1:
- renamed argument 'bufptr' (Peter Maydell)--- include/qemu-common.h | 3 ++- hw/dma/xlnx_dpdma.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/sd/sd.c | 2 +- hw/usb/redirect.c | 2 +- net/colo-compare.c | 12 ++++++------ net/net.c | 2 +- util/hexdump.c | 4 +++- 8 files changed, 16 insertions(+), 13 deletions(-)include/qemu-common.h +2
-1@@ -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 hw/dma/xlnx_dpdma.c +1
-1@@ -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)); } }hw/net/fsl_etsec/etsec.c +1
-1@@ -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;hw/sd/sd.c +1
-1@@ -1781,7 +1781,7 @@ send_response: }#ifdef DEBUG_SD -qemu_hexdump ((const char *)response, stderr,"Response" , rsplen); +qemu_hexdump (response, stderr,"Response" , rsplen);#endif return rsplen;hw/usb/redirect.c +1
-1@@ -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); }/* net/colo-compare.c +6
-6@@ -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 ;net/net.c +1
-1@@ -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) {util/hexdump.c +3
-2@@ -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 ) { --2.26.2
Re: [PATCH v2 1/2] util/hexdump: Convert to take a void pointer argument
In reply to Philippe Mathieu-DaudéQuoted 6 lines · Philippe Mathieu-Daudé
Most uses of
qemu_hexdump()do not take an array of char as input, forcing use of cast. Since we can use this helper to dump any kind of buffer, use a pointer to void argument instead.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 152 lines
---
Since v1:
- renamed argument 'bufptr' (Peter Maydell)--- include/qemu-common.h | 3 ++- hw/dma/xlnx_dpdma.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/sd/sd.c | 2 +- hw/usb/redirect.c | 2 +- net/colo-compare.c | 12 ++++++------ net/net.c | 2 +- util/hexdump.c | 4 +++- 8 files changed, 16 insertions(+), 13 deletions(-)include/qemu-common.h +2
-1@@ -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 hw/dma/xlnx_dpdma.c +1
-1@@ -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)); } }hw/net/fsl_etsec/etsec.c +1
-1@@ -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;hw/sd/sd.c +1
-1@@ -1781,7 +1781,7 @@ send_response: }#ifdef DEBUG_SD -qemu_hexdump ((const char *)response, stderr,"Response" , rsplen); +qemu_hexdump (response, stderr,"Response" , rsplen);#endif return rsplen;hw/usb/redirect.c +1
-1@@ -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); }/* net/colo-compare.c +6
-6@@ -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 ;net/net.c +1
-1@@ -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) {util/hexdump.c +3
-1@@ -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 ) {Signature · 1 line
2.26.2
Re: [PATCH v2 1/2] util/hexdump: Convert to take a void pointer argument
In reply to Philippe Mathieu-DaudéQuoted 7 lines · Philippe Mathieu-Daudé <[email protected]> 于2020年8月23日周日 上午2:11写道:
Most uses of
qemu_hexdump()do not take an array of char as input, forcing use of cast. Since we can use this helper to dump any kind of buffer, use a pointer to void argument instead.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 153 lines
---
Since v1:
- renamed argument 'bufptr' (Peter Maydell)--- include/qemu-common.h | 3 ++- hw/dma/xlnx_dpdma.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/sd/sd.c | 2 +- hw/usb/redirect.c | 2 +- net/colo-compare.c | 12 ++++++------ net/net.c | 2 +- util/hexdump.c | 4 +++- 8 files changed, 16 insertions(+), 13 deletions(-)include/qemu-common.h +2
-1@@ -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 hw/dma/xlnx_dpdma.c +1
-1@@ -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)); } }hw/net/fsl_etsec/etsec.c +1
-1@@ -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;hw/sd/sd.c +1
-1@@ -1781,7 +1781,7 @@ send_response: }#ifdef DEBUG_SD -qemu_hexdump ((const char *)response, stderr,"Response" , rsplen); +qemu_hexdump (response, stderr,"Response" , rsplen);#endif return rsplen;hw/usb/redirect.c +1
-1@@ -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); }/* net/colo-compare.c +6
-6@@ -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 ;net/net.c +1
-1@@ -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) {util/hexdump.c +3
-2@@ -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 ) { --2.26.2
Laurent Vivier
AppliedRe: [PATCH v2 1/2] util/hexdump: Convert to take a void pointer argument
In reply to Philippe Mathieu-DaudéLe 22/08/2020 à 20:09, Philippe Mathieu-Daudé a écrit :
Quoted 146 lines
Most uses of
qemu_hexdump()do not take an array of char as input, forcing use of cast. Since we can use this helper to dump any kind of buffer, use a pointer to void argument instead.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Since v1:
- renamed argument 'bufptr' (Peter Maydell)--- include/qemu-common.h | 3 ++- hw/dma/xlnx_dpdma.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/sd/sd.c | 2 +- hw/usb/redirect.c | 2 +- net/colo-compare.c | 12 ++++++------ net/net.c | 2 +- util/hexdump.c | 4 +++- 8 files changed, 16 insertions(+), 13 deletions(-)include/qemu-common.h +2
-1@@ -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 hw/dma/xlnx_dpdma.c +1
-1@@ -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)); } }hw/net/fsl_etsec/etsec.c +1
-1@@ -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;hw/sd/sd.c +1
-1@@ -1781,7 +1781,7 @@ send_response: }#ifdef DEBUG_SD -qemu_hexdump ((const char *)response, stderr,"Response" , rsplen); +qemu_hexdump (response, stderr,"Response" , rsplen);#endif return rsplen;hw/usb/redirect.c +1
-1@@ -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); }/* net/colo-compare.c +6
-6@@ -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 ;net/net.c +1
-1@@ -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) {util/hexdump.c +0
-0@@ -16,8 +16,10 @@#include "qemu/osdep.h"
util/hexdump.c line 25
Quoted 10 lines
util/hexdump.c +3
-1#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 ) {
Applied to my trivial-patches branch.
Thanks,
Laurent
PATCH v2 2/2 util/hexdump: Reorder qemu_hexdump() arguments
In reply to Philippe Mathieu-Daudéqemu_hexdump()'s pointer to the buffer and length of the buffer are closely related arguments but are widely separated in the argument list order (also, the format of <stdio.h> function prototypes is usually to have the FILE* argument coming first).
Reorder the arguments as "fp, prefix, buf, size" which is more logical.
--- include/qemu-common.h | 4 ++-- hw/dma/xlnx_dpdma.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/net/fsl_etsec/rings.c | 2 +- hw/sd/sd.c | 2 +- hw/usb/redirect.c | 2 +- net/colo-compare.c | 24 ++++++++++++------------ net/net.c | 2 +- util/hexdump.c | 4 ++-- util/iov.c | 2 +- 10 files changed, 23 insertions(+), 23 deletions(-)
include/qemu-common.h +2 -2
@@ -138,8 +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 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
hw/dma/xlnx_dpdma.c +1 -1
@@ -388,7 +388,7 @@ static void xlnx_dpdma_dump_descriptor(DPDMADescriptor *desc) {if (DEBUG_DPDMA ) {qemu_log ("DUMP DESCRIPTOR:\n" ); -qemu_hexdump (desc, stdout,"" ,sizeof (DPDMADescriptor)); +qemu_hexdump (stdout,"" , desc,sizeof (DPDMADescriptor)); } }
hw/net/fsl_etsec/etsec.c +1 -1
@@ -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 (buf, stderr,"" , size); +qemu_hexdump (stderr,"" , buf, size);#endif /* Flush is unnecessary as are already in receiving path */ etsec->need_flush = false;
hw/net/fsl_etsec/rings.c +1 -1
@@ -269,7 +269,7 @@ static void process_tx_bd(eTSEC *etsec,#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 ) {
hw/sd/sd.c +1 -1
@@ -1781,7 +1781,7 @@ send_response: }#ifdef DEBUG_SD -qemu_hexdump (response, stderr,"Response" , rsplen); +qemu_hexdump (stderr,"Response" , response, rsplen);#endif return rsplen;
hw/usb/redirect.c +1 -1
@@ -240,7 +240,7 @@ static void usbredir_log_data(USBRedirDevice *dev, const char *desc,if (dev->debug < usbredirparser_debug_data) {return ; } -qemu_hexdump (data, stderr, desc, len); +qemu_hexdump (stderr, desc, data, len); }/*
net/colo-compare.c +12 -12
@@ -494,10 +494,10 @@ sec: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);
@@ -535,10 +535,10 @@ 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 (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 {
@@ -578,10 +578,10 @@ 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 (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 {
net/net.c +1 -1
@@ -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 (buf, stdout,"net" , size); +qemu_hexdump (stdout,"net" , buf, size);#endif if (sender->link_down || !sender->peer) {
util/hexdump.c +2 -2
@@ -16,8 +16,8 @@#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;
util/iov.c +1 -1
@@ -237,7 +237,7 @@ void iov_hexdump(const struct iovec *iov, const unsigned int iov_cnt, 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); }
Signature · 1 line
2.26.2
Re: [PATCH v2 2/2] util/hexdump: Reorder qemu_hexdump() arguments
Quoted 11 lines · Philippe Mathieu-Daudé
qemu_hexdump()'s pointer to the buffer and length of the buffer are closely related arguments but are widely separated in the argument list order (also, the format of <
stdio.h> function prototypes is usually to have the FILE* argument coming first).Reorder the arguments as "fp, prefix, buf, size" which is more logical.
Suggested-by Peter Maydell <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 186 lines
--- include/qemu-common.h | 4 ++-- hw/dma/xlnx_dpdma.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/net/fsl_etsec/rings.c | 2 +- hw/sd/sd.c | 2 +- hw/usb/redirect.c | 2 +- net/colo-compare.c | 24 ++++++++++++------------ net/net.c | 2 +- util/hexdump.c | 4 ++-- util/iov.c | 2 +- 10 files changed, 23 insertions(+), 23 deletions(-)include/qemu-common.h +2
-2@@ -138,8 +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 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 hw/dma/xlnx_dpdma.c +1
-1@@ -388,7 +388,7 @@ static void xlnx_dpdma_dump_descriptor(DPDMADescriptor *desc) {if (DEBUG_DPDMA ) {qemu_log ("DUMP DESCRIPTOR:\n" ); -qemu_hexdump (desc, stdout,"" ,sizeof (DPDMADescriptor)); +qemu_hexdump (stdout,"" , desc,sizeof (DPDMADescriptor)); } }hw/net/fsl_etsec/etsec.c +1
-1@@ -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 (buf, stderr,"" , size); +qemu_hexdump (stderr,"" , buf, size);#endif /* Flush is unnecessary as are already in receiving path */ etsec->need_flush = false;hw/net/fsl_etsec/rings.c +1
-1@@ -269,7 +269,7 @@ static void process_tx_bd(eTSEC *etsec,#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 ) {hw/sd/sd.c +1
-1@@ -1781,7 +1781,7 @@ send_response: }#ifdef DEBUG_SD -qemu_hexdump (response, stderr,"Response" , rsplen); +qemu_hexdump (stderr,"Response" , response, rsplen);#endif return rsplen;hw/usb/redirect.c +1
-1@@ -240,7 +240,7 @@ static void usbredir_log_data(USBRedirDevice *dev, const char *desc,if (dev->debug < usbredirparser_debug_data) {return ; } -qemu_hexdump (data, stderr, desc, len); +qemu_hexdump (stderr, desc, data, len); }/* net/colo-compare.c +12
-12@@ -494,10 +494,10 @@ sec: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);@@ -535,10 +535,10 @@ 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 (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 {@@ -578,10 +578,10 @@ 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 (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 {net/net.c +1
-1@@ -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 (buf, stdout,"net" , size); +qemu_hexdump (stdout,"net" , buf, size);#endif if (sender->link_down || !sender->peer) {util/hexdump.c +2
-2@@ -16,8 +16,8 @@#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;util/iov.c +1
-1@@ -237,7 +237,7 @@ void iov_hexdump(const struct iovec *iov, const unsigned int iov_cnt, 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); }Signature · 1 line
2.26.2
Laurent Vivier
AppliedRe: [PATCH v2 2/2] util/hexdump: Reorder qemu_hexdump() arguments
In reply to Philippe Mathieu-DaudéLe 22/08/2020 à 20:09, Philippe Mathieu-Daudé a écrit :
Quoted 187 lines
qemu_hexdump()'s pointer to the buffer and length of the buffer are closely related arguments but are widely separated in the argument list order (also, the format of <
stdio.h> function prototypes is usually to have the FILE* argument coming first).Reorder the arguments as "fp, prefix, buf, size" which is more logical.
Suggested-by Peter Maydell <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/qemu-common.h | 4 ++-- hw/dma/xlnx_dpdma.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/net/fsl_etsec/rings.c | 2 +- hw/sd/sd.c | 2 +- hw/usb/redirect.c | 2 +- net/colo-compare.c | 24 ++++++++++++------------ net/net.c | 2 +- util/hexdump.c | 4 ++-- util/iov.c | 2 +- 10 files changed, 23 insertions(+), 23 deletions(-)include/qemu-common.h +2
-2@@ -138,8 +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 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 hw/dma/xlnx_dpdma.c +1
-1@@ -388,7 +388,7 @@ static void xlnx_dpdma_dump_descriptor(DPDMADescriptor *desc) {if (DEBUG_DPDMA ) {qemu_log ("DUMP DESCRIPTOR:\n" ); -qemu_hexdump (desc, stdout,"" ,sizeof (DPDMADescriptor)); +qemu_hexdump (stdout,"" , desc,sizeof (DPDMADescriptor)); } }hw/net/fsl_etsec/etsec.c +1
-1@@ -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 (buf, stderr,"" , size); +qemu_hexdump (stderr,"" , buf, size);#endif /* Flush is unnecessary as are already in receiving path */ etsec->need_flush = false;hw/net/fsl_etsec/rings.c +1
-1@@ -269,7 +269,7 @@ static void process_tx_bd(eTSEC *etsec,#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 ) {hw/sd/sd.c +1
-1@@ -1781,7 +1781,7 @@ send_response: }#ifdef DEBUG_SD -qemu_hexdump (response, stderr,"Response" , rsplen); +qemu_hexdump (stderr,"Response" , response, rsplen);#endif return rsplen;hw/usb/redirect.c +1
-1@@ -240,7 +240,7 @@ static void usbredir_log_data(USBRedirDevice *dev, const char *desc,if (dev->debug < usbredirparser_debug_data) {return ; } -qemu_hexdump (data, stderr, desc, len); +qemu_hexdump (stderr, desc, data, len); }/* net/colo-compare.c +12
-12@@ -494,10 +494,10 @@ sec: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);@@ -535,10 +535,10 @@ 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 (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 {@@ -578,10 +578,10 @@ 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 (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 {net/net.c +1
-1@@ -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 (buf, stdout,"net" , size); +qemu_hexdump (stdout,"net" , buf, size);#endif if (sender->link_down || !sender->peer) {util/hexdump.c +2
-2@@ -16,8 +16,8 @@#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;util/iov.c +0
-0
util/iov.c void iov_hexdump(const struct iovec *iov, const unsigned int iov_cnt, · line 243
Quoted 8 lines
util/iov.c +1
-1@@ -237,7 +237,7 @@ void iov_hexdump(const struct iovec *iov, const unsigned int iov_cnt, 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); }
Applied to my trivial-patches branch.
Thanks,
Laurent
Quoted 9 lines · Philippe Mathieu-Daudé
- Pass const void* buffer
- Reorder argumentsSupersedes: <[email protected]>
Philippe Mathieu-Daudé (2):
util/hexdump: Convert to take a void pointer argument util/hexdump: Reorderqemu_hexdump()arguments
Quoted 16 lines
include/qemu-common.h | 3 ++- hw/dma/xlnx_dpdma.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/net/fsl_etsec/rings.c | 2 +- hw/sd/sd.c | 2 +- hw/usb/redirect.c | 2 +- net/colo-compare.c | 24 ++++++++++++------------ net/net.c | 2 +- util/hexdump.c | 4 +++- util/iov.c | 2 +- 10 files changed, 24 insertions(+), 21 deletions(-)Signature · 1 line
2.26.2
Jason Wang
AppliedQuoted 9 lines · Philippe Mathieu-Daudé
- Pass const void* buffer
- Reorder argumentsSupersedes: <[email protected]>
Philippe Mathieu-Daudé (2):
util/hexdump: Convert to take a void pointer argument util/hexdump: Reorderqemu_hexdump()arguments
Quoted 12 lines
include/qemu-common.h | 3 ++- hw/dma/xlnx_dpdma.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/net/fsl_etsec/rings.c | 2 +- hw/sd/sd.c | 2 +- hw/usb/redirect.c | 2 +- net/colo-compare.c | 24 ++++++++++++------------ net/net.c | 2 +- util/hexdump.c | 4 +++- util/iov.c | 2 +- 10 files changed, 24 insertions(+), 21 deletions(-)
Applied.
Thanks
Hi Laurent,
Quoted 8 lines · Philippe Mathieu-Daudé
- Pass const void* buffer
- Reorder argumentsSupersedes: <[email protected]>
Philippe Mathieu-Daudé (2):
util/hexdump: Convert to take a void pointer argument util/hexdump: Reorderqemu_hexdump()arguments
This series is fully reviewed, can it go via
your qemu-trivial tree?
Thanks,
Phil.
Le 11/09/2020 à 16:35, Philippe Mathieu-Daudé a écrit :
Quoted 6 lines
Hi Laurent,
Quoted 3 lines · Philippe Mathieu-Daudé
- Pass const void* buffer
- Reorder arguments
Quoted 8 lines
Quoted 5 lines
Supersedes: <[email protected]>
Philippe Mathieu-Daudé (2):
util/hexdump: Convert to take a void pointer argument util/hexdump: Reorderqemu_hexdump()argumentsThis series is fully reviewed, can it go via
your qemu-trivial tree?
Done.
Thanks,
Laurent