MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / dma_map

Method dma_map

pci/src/vfio_user.rs:237–251  ·  view source on GitHub ↗
(
        &mut self,
        region: &GuestRegionMmap<AtomicBitmap>,
    )

Source from the content-addressed store, hash-verified

235 }
236
237 pub fn dma_map(
238 &mut self,
239 region: &GuestRegionMmap<AtomicBitmap>,
240 ) -> Result<(), VfioUserPciDeviceError> {
241 let (fd, offset) = match region.file_offset() {
242 Some(_file_offset) => (_file_offset.file().as_raw_fd(), _file_offset.start()),
243 None => return Ok(()),
244 };
245
246 self.client
247 .lock()
248 .unwrap()
249 .dma_map(offset, region.start_addr().raw_value(), region.len(), fd)
250 .map_err(VfioUserPciDeviceError::DmaMap)
251 }
252
253 pub fn dma_unmap(
254 &mut self,

Callers 1

mapMethod · 0.45

Calls 5

fileMethod · 0.80
start_addrMethod · 0.80
as_raw_fdMethod · 0.45
startMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected