[v4 2/3] vfio_register_notifier: also register on the group notifier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The user of vfio_register_notifier might care about not only
iommu events but also vfio_group events, so also register the
notifier_block on vfio_group.

Cc: Xiao Guangrong <guangrong.xiao@xxxxxxxxxxxxxxx>
Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Cc: Alex Williamson <alex.williamson@xxxxxxxxxx>
Signed-off-by: Jike Song <jike.song@xxxxxxxxx>
---
 drivers/vfio/vfio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index b149ced..2c0eedb 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -2065,6 +2065,8 @@ int vfio_register_notifier(struct device *dev, struct notifier_block *nb)
 	else
 		ret = -ENOTTY;
 
+	vfio_group_register_notifier(group, nb);
+
 	up_read(&container->group_lock);
 	vfio_group_try_dissolve_container(group);
 
@@ -2102,6 +2104,8 @@ int vfio_unregister_notifier(struct device *dev, struct notifier_block *nb)
 	else
 		ret = -ENOTTY;
 
+	vfio_group_unregister_notifier(group, nb);
+
 	up_read(&container->group_lock);
 	vfio_group_try_dissolve_container(group);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux