OSDN Git Service

vfio: New external user group/file match
authorAlex Williamson <alex.williamson@redhat.com>
Wed, 28 Jun 2017 19:50:05 +0000 (13:50 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2017 22:06:07 +0000 (15:06 -0700)
commit3457c0459496d028a4f47167a8b8871671abdeda
treebe46c9476658460252f2f266d5fe5ab1de847d7e
parentdb42944cc63a2db5de17b6cb572327c7ab8ab637
vfio: New external user group/file match

commit 5d6dee80a1e94cc284d03e06d930e60e8d3ecf7d upstream.

At the point where the kvm-vfio pseudo device wants to release its
vfio group reference, we can't always acquire a new reference to make
that happen.  The group can be in a state where we wouldn't allow a
new reference to be added.  This new helper function allows a caller
to match a file to a group to facilitate this.  Given a file and
group, report if they match.  Thus the caller needs to already have a
group reference to match to the file.  This allows the deletion of a
group without acquiring a new reference.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/vfio/vfio.c
include/linux/vfio.h
virt/kvm/vfio.c