fn do_dma_map(&mut self) -> Result<()> {
        let container = &self.vfio_device.container;
        let mut regions = container.vfio_mem_info.regions.lock().unwrap();

        for r in regions.iter_mut() {
            if !r.iommu_mapped {
                container
                    .vfio_dma_map(r.guest_phys_addr, r.memory_size, r.userspace_addr)
                    .chain_err(|| "Failed to add guest memory region map into IOMMU table")?;
                r.iommu_mapped = true;
            }
        }
        Ok(())
    }
/// Add all guest memory regions into IOMMU table.
Add all guest memory regions into IOMMU table.
Add all guest memory regions into IOMMU table .
fn do_dma_map(&mut self) -> Result<()> {
        let container = &self.vfio_device.container;
        let mut regions = container.vfio_mem_info.regions.lock().unwrap();
        for r in regions.iter_mut() {
            if !r.iommu_mapped {
                container
                    .vfio_dma_map(r.guest_phys_addr, r.memory_size, r.userspace_addr)
                    .chain_err(|| "Failed to add guest memory region map into IOMMU table")?;
                r.iommu_mapped = true;
            }
        }
        Ok(())
    }
fn do_dma_map ( & mut self ) -> Result < ( ) > { let container = & self . vfio_device . container ; let mut regions = container . vfio_mem_info . regions . lock ( ) . unwrap ( ) ; for r in regions . iter_mut ( ) { if ! r . iommu_mapped { container . vfio_dma_map ( r . guest_phys_addr , r . memory_size , r . userspace_addr ) . chain_err ( | | " " ) ? ; r . iommu_mapped = true ; } } Ok ( ( ) ) }
Add all guest memory regions into IOMMU table.
Add all guest memory regions into IOMMU table .
&mut self
&mut self