hw/virtio-pci: Replace error_report() by qemu_log_mask(GUEST_ERROR)
PATCH 1/1 hw/virtio-pci: Replace error_report() by qemu_log_mask(GUEST_ERROR)
Replace I/O write error reported with error_report() by qemu_log_mask(GUEST_ERROR) which allow filtering.
--- hw/virtio/virtio-pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
hw/virtio/virtio-pci.c +4 -2
@@ -27,6 +27,7 @@#include "hw/qdev-properties.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "qemu/log.h" #include "qemu/module.h" #include "hw/pci/msi.h" #include "hw/pci/msix.h"
@@ -365,8 +366,9 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)virtio_queue_set_vector (vdev, vdev->queue_sel, val);break ;default : -error_report ("%s: unexpected address 0x%x value 0x%x" , - __func__, addr, val); +qemu_log_mask (LOG_GUEST_ERROR , +"%s: unexpected address 0x%x value 0x%x\n" , + __func__, addr, val);break ; } }
Signature · 1 line
2.26.2
ping?
Quoted 33 lines · Philippe Mathieu-Daudé
Replace I/O write error reported with
error_report()byqemu_log_mask(GUEST_ERROR)which allow filtering.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/virtio/virtio-pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)hw/virtio/virtio-pci.c +4
-2@@ -27,6 +27,7 @@#include "hw/qdev-properties.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "qemu/log.h" #include "qemu/module.h" #include "hw/pci/msi.h" #include "hw/pci/msix.h" @@ -365,8 +366,9 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)virtio_queue_set_vector (vdev, vdev->queue_sel, val);break ;default : -error_report ("%s: unexpected address 0x%x value 0x%x" , - __func__, addr, val); +qemu_log_mask (LOG_GUEST_ERROR , +"%s: unexpected address 0x%x value 0x%x\n" , + __func__, addr, val);break ; } }
Quoted 22 lines · Philippe Mathieu-Daudé
Replace I/O write error reported with
error_report()byqemu_log_mask(GUEST_ERROR)which allow filtering.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/virtio/virtio-pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)hw/virtio/virtio-pci.c +1
-0@@ -27,6 +27,7 @@#include "hw/qdev-properties.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "qemu/log.h" #include "qemu/module.h" #include "hw/pci/msi.h" #include "hw/pci/msix.h" @@ -365,8 +366,9 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)virtio_queue_set_vector (vdev, vdev->queue_sel, val);
hw/virtio/virtio-pci.c static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) · line 374
Quoted 10 lines
hw/virtio/virtio-pci.c +3
-2break ;default : -error_report ("%s: unexpected address 0x%x value 0x%x" , - __func__, addr, val); +qemu_log_mask (LOG_GUEST_ERROR , +"%s: unexpected address 0x%x value 0x%x\n" , + __func__, addr, val);break ; } }
Quoted 13 lines · Philippe Mathieu-Daudé
Replace I/O write error reported with
error_report()byqemu_log_mask(GUEST_ERROR)which allow filtering.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
hw/virtio/virtio-pci.c| 6 ++++--1 file changed, 4 insertions(+), 2 deletions(-)hw/virtio/virtio-pci.c +0
-0
hw/virtio/virtio-pci.c line 29
Quoted 3 lines
hw/virtio/virtio-pci.c +0
-0@@ -27,6 +27,7 @@#include "hw/qdev-properties.h" #include "qapi/error.h" #include "qemu/error-report.h"
^
Just a little thing, could we remove this inclusion since we are not using error_report() anymore in this file?
Anyway the patch LGTM:
Quoted 20 lines
hw/virtio/virtio-pci.c +4
-2+#include "qemu/log.h" #include "qemu/module.h" #include "hw/pci/msi.h" #include "hw/pci/msix.h" @@ -365,8 +366,9 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)virtio_queue_set_vector (vdev, vdev->queue_sel, val);break ;default : -error_report ("%s: unexpected address 0x%x value 0x%x" , - __func__, addr, val); +qemu_log_mask (LOG_GUEST_ERROR , +"%s: unexpected address 0x%x value 0x%x\n" , + __func__, addr, val);break ; } }Signature · 1 line
2.26.2
Quoted 9 lines · Stefano Garzarella
Quoted 8 lines · Philippe Mathieu-Daudé
Replace I/O write error reported with
error_report()byqemu_log_mask(GUEST_ERROR)which allow filtering.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
hw/virtio/virtio-pci.c| 6 ++++--1 file changed, 4 insertions(+), 2 deletions(-)
Quoted 11 lines
hw/virtio/virtio-pci.c line 29
Quoted 8 lines
hw/virtio/virtio-pci.c +0
-0@@ -27,6 +27,7 @@#include "hw/qdev-properties.h" #include "qapi/error.h" #include "qemu/error-report.h" ^
Just a little thing, could we remove this inclusion since we are not usingerror_report()anymore in this file?
We can't because virtio_pci_device_plugged() calls warn_report() twice :/
Quoted 3 lines
Anyway the patch LGTM:
Reviewed-by Stefano Garzarella <[email protected]>
Thanks!
Phil.
Quoted 22 lines · Philippe Mathieu-Daudé
Quoted 9 lines · Stefano Garzarella
Quoted 8 lines · Philippe Mathieu-Daudé
Replace I/O write error reported with
error_report()byqemu_log_mask(GUEST_ERROR)which allow filtering.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
hw/virtio/virtio-pci.c| 6 ++++--1 file changed, 4 insertions(+), 2 deletions(-)Quoted 11 lines
hw/virtio/virtio-pci.c line 29
Quoted 8 lines
hw/virtio/virtio-pci.c +0
-0@@ -27,6 +27,7 @@#include "hw/qdev-properties.h" #include "qapi/error.h" #include "qemu/error-report.h" ^
Just a little thing, could we remove this inclusion since we are not usingerror_report()anymore in this file?
Quoted 2 lines
We can't because
virtio_pci_device_plugged()callswarn_report()twice :/
Of course you are right :-)
Stefano
Quoted 9 lines
Quoted 4 lines
Anyway the patch LGTM:
Reviewed-by Stefano Garzarella <[email protected]>Thanks!
Phil.
Laurent Vivier
AppliedLe 10/12/2020 à 18:28, Philippe Mathieu-Daudé a écrit :
Quoted 23 lines
Replace I/O write error reported with
error_report()byqemu_log_mask(GUEST_ERROR)which allow filtering.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/virtio/virtio-pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)hw/virtio/virtio-pci.c +1
-0@@ -27,6 +27,7 @@#include "hw/qdev-properties.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "qemu/log.h" #include "qemu/module.h" #include "hw/pci/msi.h" #include "hw/pci/msix.h" @@ -365,8 +366,9 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)virtio_queue_set_vector (vdev, vdev->queue_sel, val);
hw/virtio/virtio-pci.c static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) · line 374
Quoted 10 lines
hw/virtio/virtio-pci.c +3
-2break ;default : -error_report ("%s: unexpected address 0x%x value 0x%x" , - __func__, addr, val); +qemu_log_mask (LOG_GUEST_ERROR , +"%s: unexpected address 0x%x value 0x%x\n" , + __func__, addr, val);break ; } }
Applied to my trivial-patches branch.
Thanks,
Laurent