From b42581f5bb40489cb172829e9ab0d6d6dfa37026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sat, 22 Aug 2020 20:09:50 +0200 Subject: util/hexdump: Reorder qemu_hexdump() arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias Reviewed-by: Stefano Garzarella Message-Id: <20200822180950.1343963-3-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- net/colo-compare.c | 24 ++++++++++++------------ net/net.c | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'net') diff --git a/net/colo-compare.c b/net/colo-compare.c index 550272b3ba..4a5ed642e9 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -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 { diff --git a/net/net.c b/net/net.c index f3e5d533fd..7a2a0fb5ac 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(buf, stdout, "net", size); + qemu_hexdump(stdout, "net", buf, size); #endif if (sender->link_down || !sender->peer) { -- cgit v1.2.3