@@ -88,7 +88,7 @@ Step 2: configure QEMU
----------------------
Interactions with the ``/dev/iommu`` are abstracted by a new iommufd
-object (compiled in with the ``CONFIG_IOMMUFD`` option).
+object (which availability can be checked at runtime using ``iommufd_builtin()``).
Any QEMU device (e.g. VFIO device) wishing to use ``/dev/iommu`` must
be linked with an iommufd object. It gets a new optional property
@@ -63,4 +63,10 @@ bool iommufd_backend_get_dirty_bitmap(IOMMUFDBackend *be, uint32_t hwpt_id,
Error **errp);
#define TYPE_HOST_IOMMU_DEVICE_IOMMUFD TYPE_HOST_IOMMU_DEVICE "-iommufd"
+
+static inline bool iommufd_builtin(void)
+{
+ return type_is_registered(TYPE_IOMMUFD_BACKEND);
+}
+
#endif
iommufd_builtin() can be used to check at runtime whether the IOMMUFD feature is built in a qemu-system binary. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- docs/devel/vfio-iommufd.rst | 2 +- include/system/iommufd.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)