diff --git a/virttest/qemu_vm.py b/virttest/qemu_vm.py index ec92363a6b..5853dc8766 100644 --- a/virttest/qemu_vm.py +++ b/virttest/qemu_vm.py @@ -1914,6 +1914,17 @@ def __iothread_conflict_check(params): ) devices.insert(dev) + if params.get("vm_iommu_model") == "amd" and devices.has_device("amd-iommu"): + iommu_params = { + "device-iotlb": params.get("iommu_device_iotlb"), + "intremap": params.get("iommu_intremap"), + "pt": params.get("iommu_pt"), + "xtsup": params.get("iommu_xtsup"), + } + dev = QDevice("amd-iommu", iommu_params) + set_cmdline_format_by_cfg(dev, self._get_cmdline_format_cfg(), "iommu_dev") + devices.insert(dev) + # Add device virtio-iommu, it must be added before any virtio devices if params.get_boolean("virtio_iommu") and devices.has_device( "virtio-iommu-pci"