mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: release vIOMMU VFIO container on device eject
Currently ejecting a device leaks its mapping keeping the container fd open. Remove the mapping so the fd can be closed. Assisted-by: Claude:Opus-4.8 Signed-off-by: Dylan Reid <dgreid@fb.com>
This commit is contained in:
@@ -5020,6 +5020,13 @@ impl DeviceManager {
|
||||
}
|
||||
};
|
||||
|
||||
if let Some(iommu) = &self.iommu_device {
|
||||
iommu
|
||||
.lock()
|
||||
.unwrap()
|
||||
.remove_external_mapping(pci_device_bdf.into());
|
||||
}
|
||||
|
||||
if remove_dma_handler {
|
||||
for virtio_mem_device in self.virtio_mem_devices.iter() {
|
||||
let source = VirtioMemMappingSource::Device(pci_device_bdf.into());
|
||||
|
||||
Reference in New Issue
Block a user