pub fn vfio_map_guest_memory<M: GuestMemory>(&self, mem: &M) -> Result<()> {
        mem.iter().try_for_each(|region| {
            let host_addr = region
                .get_host_address(MemoryRegionAddress(0))
                .map_err(|_| VfioError::IommuDmaMap)?;
            self.vfio_dma_map(
                region.start_addr().raw_value(),
                region.len() as u64,
                host_addr as u64,
            )
        })
    }
/// Add all guest memory regions into the vfio container's iommu table.
///
/// # Parameters
/// * mem: pinned guest memory which could be accessed by devices binding to the container.
Add all guest memory regions into the vfio container's iommu table.
Add all guest memory regions into the vfio container ' s iommu table .
pub fn vfio_map_guest_memory<M: GuestMemory>(&self, mem: &M) -> Result<()> {
        mem.iter().try_for_each(|region| {
            let host_addr = region
                .get_host_address(MemoryRegionAddress(0))
                .map_err(|_| VfioError::IommuDmaMap)?;
            self.vfio_dma_map(
                region.start_addr().raw_value(),
                region.len() as u64,
                host_addr as u64,
            )
        })
    }
pub fn vfio_map_guest_memory < M : GuestMemory > ( & self , mem : & M ) -> Result < ( ) > { mem . iter ( ) . try_for_each ( | region | { let host_addr = region . get_host_address ( MemoryRegionAddress ( 0 ) ) . map_err ( | _ | VfioError :: IommuDmaMap ) ? ; self . vfio_dma_map ( region . start_addr ( ) . raw_value ( ) , region . len ( ) as u64 , host_addr as u64 , ) } ) }
Add all guest memory regions into the vfio container's iommu table.
Add all guest memory regions into the vfio container ' s iommu table .
&self
mem
&M