Hi Thomas, > > +/* DMA mapping function prototype. > > + * Takes VFIO container fd as a parameter. > > + * Returns 0 on success, -1 on error. > > + * */ > > +typedef int (*vfio_dma_func_t)(int); > > + > > +struct vfio_iommu_type { > > + int type_id; > > + const char *name; > > + vfio_dma_func_t dma_map_func; > > +}; > > + > > +int vfio_iommu_type1_dma_map(int); > > +int vfio_iommu_noiommu_dma_map(int); > > Is it possible (is it better) to declare these functions with vfio_dma_func_t?
Yeah, sure. Or maybe the other way around - maybe we could do away with the typedef. I'll go for the former though. > vfio_iommu_noiommu_dma_map is a weird name. > Why not vfio_noiommu_dma_map or vfio_iommu_none_dma_map? Well, the NOIOMMU type is named VFIO_IOMMU_NOIOMMU in the VFIO headers. So it's consistent with the IOMMU type name. Although vfio_noiommu_dma_map seems reasonable. Thanks, Anatoly