Writes the local copy of the packet header to the guest memory.
(&mut self, guest_mem: &M)
| 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 | /// |
no test coverage detected