Hi,

This patch follows up on a previous attempt [1] to improve error messages in
virtio_init_region_cache(), where the messages:

    Cannot map desc
    Cannot map used
    Cannot map avail

were changed to:

    Virtio cannot map desc
    ...

While this was an improvement in clarity, a reviewer (Alex Bennée)
pointed out that all such messages go through virtio_error(), and suggested
a cleaner and more scalable solution: prefixing all messages in
virtio_error() itself.

This patch implements that suggestion. It modifies virtio_error() to prepend
"virtio: " to all messages, improving clarity across all call sites without
duplicating the prefix manually.

I tested the change by forcibly triggering an error inside
virtio_init_region_cache() and verified the resulting output includes the
new prefix, as expected.

  ~/qemu/build$ sudo ./qemu-system-x86_64  \
      -enable-kvm   \
      -m 512   \
      -drive \
      if=virtio,file=/tmp/some.img,format=raw
  qemu-system-x86_64: virtio: Cannot map used (debug test)
  qemu-system-x86_64: virtio: Cannot map used (debug test)
  qemu-system-x86_64: virtio: Cannot map used (debug test)
  qemu-system-x86_64: virtio: Cannot map used (debug test)
  qemu-system-x86_64: virtio: Cannot map used (debug test)
  qemu-system-x86_64: virtio: Cannot map used (debug test)
  ^Cqemu-system-x86_64: terminating on signal 2

This should address the original concern in a more maintainable way.

Thank you for your time and consideration.

Best regards,
Alessandro Ratti

[1]: 
https://patchwork.kernel.org/project/qemu-devel/patch/[email protected]/

Reply via email to