From efba48dddb9239a39f772e2e9146df16f31f6956 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Wed, 11 Mar 2020 18:23:11 +0100 Subject: [PATCH] vmm: Don't put a VFIO device behind the vIOMMU by default With some of the factorization that happened to be able to support VFIO hotplug, one mistake was made. In case a vIOMMU is created through a virtio-iommu device, and no matter the "iommu" option value from the VFIO device parameter, the VFIO device was always placed behind the virtual IOMMU. This commit fixes this wrong behavior by making sure the device configuration is taken into account to decide if it should be attached or not to the virtual IOMMU. Signed-off-by: Sebastien Boeuf --- vmm/src/device_manager.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index 4f89a0d85..e12f57a26 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -1591,7 +1591,7 @@ impl DeviceManager { for device_cfg in device_list_cfg.iter_mut() { let device_id = self.add_vfio_device(pci, interrupt_manager, &device_fd, device_cfg)?; - if self.iommu_device.is_some() { + if device_cfg.iommu && self.iommu_device.is_some() { iommu_attached_device_ids.push(device_id); } }