vmm: Provide DMA mapping handlers to virtio-mem devices

Now that virtio-mem devices can update VFIO mappings through dedicated
handlers, let's provide them from the DeviceManager.

Important to note these handlers should either be provided to virtio-mem
devices or to the unique virtio-iommu device. This must be mutually
exclusive.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2021-03-03 11:59:53 +01:00
parent 61f9a4ec6c
commit 933d41cf2f
2 changed files with 43 additions and 8 deletions

View File

@@ -354,6 +354,10 @@ impl VfioPciDevice {
Ok(vfio_pci_device)
}
pub fn iommu_attached(&self) -> bool {
self.iommu_attached
}
fn enable_intx(&mut self) -> Result<()> {
if let Some(intx) = &mut self.interrupt.intx {
if !intx.enabled {