qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 01/27] util/hexdump: Remove b parameter from qemu_hexdump_


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v3 01/27] util/hexdump: Remove b parameter from qemu_hexdump_line
Date: Fri, 12 Apr 2024 12:00:14 +0200
User-agent: Mozilla Thunderbird

On 12/4/24 09:33, Richard Henderson wrote:
Require that the caller output the offset and increment bufptr.
Use QEMU_HEXDUMP_LINE_BYTES in vhost_vdpa_dump_config instead
of raw integer.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
  include/qemu/cutils.h  |  2 +-
  hw/virtio/vhost-vdpa.c |  4 ++--
  util/hexdump.c         | 13 ++++++-------
  hw/virtio/trace-events |  2 +-
  4 files changed, 10 insertions(+), 11 deletions(-)


@@ -58,8 +57,8 @@ void qemu_hexdump(FILE *fp, const char *prefix,
for (b = 0; b < size; b += QEMU_HEXDUMP_LINE_BYTES) {
          len = size - b;
-        qemu_hexdump_line(line, b, bufptr, len, true);
-        fprintf(fp, "%s: %s\n", prefix, line);
+        qemu_hexdump_line(line, bufptr + b, len, true);
+        fprintf(fp, "%s: %04x: %s\n", prefix, b, line);

Clever :)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]