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.hender...@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é <phi...@linaro.org>


Reply via email to