On Fri, Jun 02, 2023 at 05:15:13AM -0700, Yi Liu wrote: > There are drivers that need to search vfio_device within a given dev_set. > e.g. vfio-pci. So add a helper. > > vfio_pci_is_device_in_set() now returns -EBUSY in commit a882c16a2b7e > ("vfio/pci: Change vfio_pci_try_bus_reset() to use the dev_set") where > it was trying to preserve the return of vfio_pci_try_zap_and_vma_lock_cb(). > However, it makes more sense to return -ENODEV. > > Suggested-by: Alex Williamson <alex.williamson@xxxxxxxxxx> > Tested-by: Terrence Xu <terrence.xu@xxxxxxxxx> > Signed-off-by: Yi Liu <yi.l.liu@xxxxxxxxx> > --- > drivers/vfio/pci/vfio_pci_core.c | 6 +----- > drivers/vfio/vfio_main.c | 15 +++++++++++++++ > include/linux/vfio.h | 3 +++ > 3 files changed, 19 insertions(+), 5 deletions(-) Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx> Jason