virtio: Only display errors if GUEST_ERROR is enabled
RFC PATCH 1/1 virtio: Only display errors if GUEST_ERROR is enabled
Do not display virtio guest errors until the user request it.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
--- hw/virtio/virtio.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
hw/virtio/virtio.c +5 -3
@@ -3622,9 +3622,11 @@ void GCC_FMT_ATTR(2, 3) virtio_error(VirtIODevice *vdev, const char *fmt, ...) {va_list ap; -va_start (ap, fmt); -error_vreport (fmt, ap); -va_end (ap); +if (qemu_loglevel_mask (LOG_GUEST_ERROR )) { +va_start (ap, fmt); +error_vreport (fmt, ap); +va_end (ap); + }if (virtio_vdev_has_feature (vdev,VIRTIO_F_VERSION_1 )) { vdev->status = vdev->status |VIRTIO_CONFIG_S_NEEDS_RESET ;
Signature · 1 line
2.26.2
Quoted 12 lines · Philippe Mathieu-Daudé
Do not display virtio guest errors until the user request it.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/virtio/virtio.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)hw/virtio/virtio.c +0
-0
hw/virtio/virtio.c void GCC_FMT_ATTR(2, 3) virtio_error(VirtIODevice *vdev, const char *fmt, ...) · line 3625
Quoted 7 lines
hw/virtio/virtio.c +1
-3@@ -3622,9 +3622,11 @@ void GCC_FMT_ATTR(2, 3) virtio_error(VirtIODevice *vdev, const char *fmt, ...) {va_list ap; -va_start (ap, fmt); -error_vreport (fmt, ap); -va_end (ap); +if (qemu_loglevel_mask (LOG_GUEST_ERROR )) {
Hmm could move the 'va_list ap;' declaration here.
Quoted 8 lines
hw/virtio/virtio.c +4
-0+va_start (ap, fmt); +error_vreport (fmt, ap); +va_end (ap); + }if (virtio_vdev_has_feature (vdev,VIRTIO_F_VERSION_1 )) { vdev->status = vdev->status |VIRTIO_CONFIG_S_NEEDS_RESET ;