mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices, vmm: Register a DMA handler to VirtioPciDevice
Given that some virtio device might need some DMA handling, we provide a way to store this through the VirtioPciDevice layer, so that it can be accessed when the PCI device is removed. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -3295,7 +3295,7 @@ impl DeviceManager {
|
||||
iommu_mapping: &Option<Arc<IommuMapping>>,
|
||||
virtio_device_id: String,
|
||||
pci_segment_id: u16,
|
||||
_dma_handler: Option<Arc<dyn ExternalDmaMapping>>,
|
||||
dma_handler: Option<Arc<dyn ExternalDmaMapping>>,
|
||||
) -> DeviceManagerResult<PciBdf> {
|
||||
let id = format!("{}-{}", VIRTIO_PCI_DEVICE_NAME_PREFIX, virtio_device_id);
|
||||
|
||||
@@ -3385,6 +3385,7 @@ impl DeviceManager {
|
||||
// to firmware without requiring excessive identity mapping.
|
||||
// The exception being if not on the default PCI segment.
|
||||
pci_segment_id > 0 || device_type != VirtioDeviceType::Block as u32,
|
||||
dma_handler,
|
||||
)
|
||||
.map_err(DeviceManagerError::VirtioDevice)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user