Skip to contentSkip to conversation

vfio/pci: Report errors from qdev_unplug() via device request

PATCH In review Alex Williamson 3 participants 3 messages Feb 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfio/pci: Report errors from qdev_unplug() via device request

Currently we ignore this error, report it with error_reportf_err()

---
 hw/vfio/pci.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
hw/vfio/pci.c +5 -1
index 332f41d6627f..f2ba9b6cfafc 100644
@@ -2506,12 +2506,16 @@ static void vfio_unregister_err_notifier(VFIOPCIDevice *vdev)
 static void vfio_req_notifier_handler(void *opaque)
 {
     VFIOPCIDevice *vdev = opaque;
+    Error *err = NULL;
 
     if (!event_notifier_test_and_clear(&vdev->req_notifier)) {
         return;
     }
 
-    qdev_unplug(&vdev->pdev.qdev, NULL);
+    qdev_unplug(&vdev->pdev.qdev, &err);
+    if (err) {
+        error_reportf_err(err, WARN_PREFIX, vdev->vbasedev.name);
+    }
 }
 
 static void vfio_register_req_notifier(VFIOPCIDevice *vdev)
Reviewed-by on v1 1/1
#1 lore raw

Hi Alex,

Quoted 3 lines · Alex Williamson

Currently we ignore this error, report it with error_reportf_err()

Eric

Quoted 27 lines
---
 hw/vfio/pci.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
hw/vfio/pci.c +5 -1
index 332f41d6627f..f2ba9b6cfafc 100644
@@ -2506,12 +2506,16 @@ static void vfio_unregister_err_notifier(VFIOPCIDevice *vdev)
 static void vfio_req_notifier_handler(void *opaque)
 {
     VFIOPCIDevice *vdev = opaque;
+    Error *err = NULL;
 
     if (!event_notifier_test_and_clear(&vdev->req_notifier)) {
         return;
     }
 
-    qdev_unplug(&vdev->pdev.qdev, NULL);
+    qdev_unplug(&vdev->pdev.qdev, &err);
+    if (err) {
+        error_reportf_err(err, WARN_PREFIX, vdev->vbasedev.name);
+    }
 }
 
 static void vfio_register_req_notifier(VFIOPCIDevice *vdev)
#2 lore raw
Quoted 9 lines · Auger Eric

Hi Alex,

Quoted 3 lines · Alex Williamson

Currently we ignore this error, report it with error_reportf_err()

Eric

Quoted 29 lines
Quoted 28 lines
---
 hw/vfio/pci.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
hw/vfio/pci.c +5 -1
index 332f41d6627f..f2ba9b6cfafc 100644
@@ -2506,12 +2506,16 @@ static void vfio_unregister_err_notifier(VFIOPCIDevice *vdev)
 static void vfio_req_notifier_handler(void *opaque)
 {
     VFIOPCIDevice *vdev = opaque;
+    Error *err = NULL;
 
     if (!event_notifier_test_and_clear(&vdev->req_notifier)) {
         return;
     }
 
-    qdev_unplug(&vdev->pdev.qdev, NULL);
+    qdev_unplug(&vdev->pdev.qdev, &err);
+    if (err) {
+        error_reportf_err(err, WARN_PREFIX, vdev->vbasedev.name);
+    }
 }
 
 static void vfio_register_req_notifier(VFIOPCIDevice *vdev)