Commit 467c084f authored by Alex Williamson's avatar Alex Williamson
Browse files

vfio/pci: Implement match ops



This currently serves the same purpose as the default implementation
but will be expanded for additional functionality.

Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 5f3874c2
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1278,6 +1278,13 @@ static void vfio_pci_request(void *device_data, unsigned int count)
	mutex_unlock(&vdev->igate);
}

static int vfio_pci_match(void *device_data, char *buf)
{
	struct vfio_pci_device *vdev = device_data;

	return !strcmp(pci_name(vdev->pdev), buf);
}

static const struct vfio_device_ops vfio_pci_ops = {
	.name		= "vfio-pci",
	.open		= vfio_pci_open,
@@ -1287,6 +1294,7 @@ static const struct vfio_device_ops vfio_pci_ops = {
	.write		= vfio_pci_write,
	.mmap		= vfio_pci_mmap,
	.request	= vfio_pci_request,
	.match		= vfio_pci_match,
};

static int vfio_pci_reflck_attach(struct vfio_pci_device *vdev);