]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
vfio: selftests: Rename struct vfio_iommu_mode to iommu_mode
authorDavid Matlack <dmatlack@google.com>
Wed, 26 Nov 2025 23:17:19 +0000 (23:17 +0000)
committerAlex Williamson <alex@shazbot.org>
Fri, 28 Nov 2025 17:58:06 +0000 (10:58 -0700)
Rename struct vfio_iommu_mode to struct iommu_mode since the mode can
include iommufd. This also prepares for splitting out all the IOMMU code
into its own structs/helpers/files which are independent from the
vfio_pci_device code.

No function change intended.

Reviewed-by: Alex Mastro <amastro@fb.com>
Tested-by: Alex Mastro <amastro@fb.com>
Reviewed-by: Raghavendra Rao Ananta <rananta@google.com>
Signed-off-by: David Matlack <dmatlack@google.com>
Link: https://lore.kernel.org/r/20251126231733.3302983-5-dmatlack@google.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
tools/testing/selftests/vfio/lib/include/vfio_util.h
tools/testing/selftests/vfio/lib/vfio_pci_device.c

index 0b9a5628d23e93a6be3624b380ece3f7aab772bd..2f5555138d7f4c702844f45f3750e1efcdb21b33 100644 (file)
@@ -50,7 +50,7 @@
        VFIO_LOG_AND_EXIT(_fmt, ##__VA_ARGS__);                 \
 } while (0)
 
-struct vfio_iommu_mode {
+struct iommu_mode {
        const char *name;
        const char *container_path;
        unsigned long iommu_type;
@@ -166,7 +166,7 @@ struct vfio_pci_driver {
 struct vfio_pci_device {
        int fd;
 
-       const struct vfio_iommu_mode *iommu_mode;
+       const struct iommu_mode *iommu_mode;
        int group_fd;
        int container_fd;
 
index eda8f14de79711fde3c5c9dbc153c99c88440491..4a021ff4fc40d8d3664a93d01259b55f3eea8872 100644 (file)
@@ -713,7 +713,7 @@ const char *vfio_pci_get_cdev_path(const char *bdf)
 }
 
 /* Reminder: Keep in sync with FIXTURE_VARIANT_ADD_ALL_IOMMU_MODES(). */
-static const struct vfio_iommu_mode iommu_modes[] = {
+static const struct iommu_mode iommu_modes[] = {
        {
                .name = "vfio_type1_iommu",
                .container_path = "/dev/vfio/vfio",
@@ -741,7 +741,7 @@ static const struct vfio_iommu_mode iommu_modes[] = {
 
 const char *default_iommu_mode = "iommufd";
 
-static const struct vfio_iommu_mode *lookup_iommu_mode(const char *iommu_mode)
+static const struct iommu_mode *lookup_iommu_mode(const char *iommu_mode)
 {
        int i;