From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jike Song Subject: [v4 2/3] vfio_register_notifier: also register on the group notifier Date: Tue, 15 Nov 2016 19:35:46 +0800 Message-ID: <1479209747-5564-3-git-send-email-jike.song@intel.com> References: <1479209747-5564-1-git-send-email-jike.song@intel.com> Cc: kwankhede@nvidia.com, cjia@nvidia.com, kevin.tian@intel.com, kvm@vger.kernel.org, jike.song@intel.com To: alex.williamson@redhat.com, pbonzini@redhat.com, guangrong.xiao@linux.intel.com Return-path: Received: from mga09.intel.com ([134.134.136.24]:6706 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753073AbcKOLmc (ORCPT ); Tue, 15 Nov 2016 06:42:32 -0500 In-Reply-To: <1479209747-5564-1-git-send-email-jike.song@intel.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 Cc: Paolo Bonzini Cc: Alex Williamson Signed-off-by: Jike Song --- 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