@@ -54,7 +54,8 @@ static void vfio_disable_interrupts(VFIOPCIDevice *vdev);
static void vfio_mmap_set_enabled(VFIOPCIDevice *vdev, bool enabled);
static void vfio_msi_disable_common(VFIOPCIDevice *vdev);
-static bool vfio_notifier_init(EventNotifier *e, const char *name, Error **errp)
+static bool vfio_notifier_init(VFIOPCIDevice *vdev, EventNotifier *e,
+ const char *name, int nr, Error **errp)
{
int ret = event_notifier_init(e, 0);
@@ -144,7 +145,7 @@ static bool vfio_intx_enable_kvm(VFIOPCIDevice *vdev, Error **errp)
pci_irq_deassert(&vdev->pdev);
/* Get an eventfd for resample/unmask */
- if (!vfio_notifier_init(&vdev->intx.unmask, "intx-unmask", errp)) {
+ if (!vfio_notifier_init(vdev, &vdev->intx.unmask, "intx-unmask", 0, errp)) {
goto fail;
}
@@ -297,7 +298,8 @@ static bool vfio_intx_enable(VFIOPCIDevice *vdev, Error **errp)
}
#endif
- if (!vfio_notifier_init(&vdev->intx.interrupt, "intx-interrupt", errp)) {
+ if (!vfio_notifier_init(vdev, &vdev->intx.interrupt, "intx-interrupt", 0,
+ errp)) {
return false;
}
fd = event_notifier_get_fd(&vdev->intx.interrupt);
@@ -485,7 +487,8 @@ static void vfio_connect_kvm_msi_virq(VFIOMSIVector *vector, int nr)
return;
}
- if (!vfio_notifier_init(&vector->kvm_interrupt, name, NULL)) {
+ if (!vfio_notifier_init(vector->vdev, &vector->kvm_interrupt, name, nr,
+ NULL)) {
goto fail_notifier;
}
@@ -528,7 +531,7 @@ static void vfio_vector_init(VFIOPCIDevice *vdev, int nr)
vector->vdev = vdev;
vector->virq = -1;
- if (!vfio_notifier_init(&vector->interrupt, "interrupt", &err)) {
+ if (!vfio_notifier_init(vdev, &vector->interrupt, "interrupt", nr, &err)) {
error_report_err(err);
}
vector->use = true;
@@ -762,7 +765,8 @@ retry:
vector->virq = -1;
vector->use = true;
- if (!vfio_notifier_init(&vector->interrupt, "interrupt", &err)) {
+ if (!vfio_notifier_init(vdev, &vector->interrupt, "interrupt", i,
+ &err)) {
error_report_err(err);
}
@@ -2875,7 +2879,8 @@ static void vfio_register_err_notifier(VFIOPCIDevice *vdev)
return;
}
- if (!vfio_notifier_init(&vdev->err_notifier, "err_notifier", &err)) {
+ if (!vfio_notifier_init(vdev, &vdev->err_notifier, "err_notifier", 0,
+ &err)) {
error_report_err(err);
vdev->pci_aer = false;
return;
@@ -2941,7 +2946,8 @@ static void vfio_register_req_notifier(VFIOPCIDevice *vdev)
return;
}
- if (!vfio_notifier_init(&vdev->req_notifier, "req_notifier", &err)) {
+ if (!vfio_notifier_init(vdev, &vdev->req_notifier, "req_notifier", 0,
+ &err)) {
error_report_err(err);
return;
}
Pass vdev and nr to vfio_notifier_init, for use by CPR in a subsequent patch. No functional change. Signed-off-by: Steve Sistare <steven.sistare@oracle.com> --- hw/vfio/pci.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)