diff --git a/lib/vhost/vhost_iommu.c b/lib/vhost/vhost_iommu.c index 8b50e7922..a785e3316 100644 --- a/lib/vhost/vhost_iommu.c +++ b/lib/vhost/vhost_iommu.c @@ -33,6 +33,12 @@ #include "spdk/stdinc.h" +#include "vhost_iommu.h" + +#include + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) + #include #include "spdk/env.h" @@ -40,8 +46,6 @@ #include "spdk_internal/log.h" -#include "vhost_iommu.h" - struct vfio_map { uint64_t iova; uint64_t size; @@ -303,3 +307,19 @@ int spdk_iommu_mem_unregister(uint64_t addr, uint64_t len) } SPDK_LOG_REGISTER_TRACE_FLAG("vhost_vfio", SPDK_TRACE_VHOST_VFIO) + +#else + +/* linux/vfio.h not available */ + +int spdk_iommu_mem_register(uint64_t addr, uint64_t len) +{ + return 0; +} + +int spdk_iommu_mem_unregister(uint64_t addr, uint64_t len) +{ + return 0; +} + +#endif