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

Method commit_hdr

virtio-devices/src/vsock/packet.rs:374–384  ·  view source on GitHub ↗

Writes the local copy of the packet header to the guest memory.

(&mut self, guest_mem: &M)

Source from the content-addressed store, hash-verified

372 /// Writes the local copy of the packet header to the guest memory.
373 ///
374 pub fn commit_hdr<M: GuestMemory>(&mut self, guest_mem: &M) -> Result<()> {
375 if self.len() as usize > defs::MAX_PKT_BUF_SIZE {
376 return Err(VsockError::InvalidPktLen(self.len()));
377 }
378
379 guest_mem
380 .write(self.hdr(), self.guest_hdr_addr)
381 .map_err(|_| VsockError::GuestMemory)?;
382
383 Ok(())
384 }
385
386 /// Provides in-place, byte-slice access to the vsock packet data buffer.
387 ///

Callers 1

process_rxMethod · 0.80

Calls 3

hdrMethod · 0.80
lenMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected