Hi,

In a previous attempt [1] to improve virtio error messages I didn’t fully
understand the suggestion made by Alex Bennée in a previous attempt [2].

This patch implements his idea more faithfully: instead of hard-coding a
"virtio" prefix at the call sites, we prepend the function name within
virtio_error() itself. This centralizes the change, avoids duplication,
and makes the log messages more informative.

For example, after forcibly triggering an error inside
virtio_init_region_cache(), the resulting output now shows the function
context clearly:

    ~/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_init_region_cache: Cannot map used
    qemu-system-x86_64: virtio_init_region_cache: Cannot map used
    ...

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

Thank you for your time and consideration.

Best regards,
Alessandro Ratti

[1]: 
https://lore.kernel.org/qemu-devel/[email protected]/T/#t
[2]: 
https://patchwork.kernel.org/project/qemu-devel/patch/[email protected]/

Reply via email to