mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vm-virtio: iommu: Expect an identifier upon device creation
This identifier is chosen from the DeviceManager so that it will manage all identifiers across the VM, which will ensure uniqueness. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Rob Bradford
parent
052eff1ca7
commit
556871570e
@@ -788,9 +788,11 @@ impl DeviceManager {
|
||||
Arc::clone(&self.address_manager) as Arc<dyn DeviceRelocation>,
|
||||
);
|
||||
|
||||
let iommu_id = String::from(IOMMU_DEVICE_NAME);
|
||||
|
||||
let (iommu_device, iommu_mapping) = if self.config.lock().unwrap().iommu {
|
||||
let (device, mapping) =
|
||||
vm_virtio::Iommu::new().map_err(DeviceManagerError::CreateVirtioIommu)?;
|
||||
let (device, mapping) = vm_virtio::Iommu::new(iommu_id.clone())
|
||||
.map_err(DeviceManagerError::CreateVirtioIommu)?;
|
||||
let device = Arc::new(Mutex::new(device));
|
||||
self.iommu_device = Some(Arc::clone(&device));
|
||||
(Some(device), Some(mapping))
|
||||
@@ -841,7 +843,7 @@ impl DeviceManager {
|
||||
&mut pci_bus,
|
||||
&None,
|
||||
&interrupt_manager,
|
||||
Some(String::from(IOMMU_DEVICE_NAME)),
|
||||
Some(iommu_id),
|
||||
)?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user