pub fn from_rx_virtq_head(hdr_desc: &DescriptorChain) -> Result<Self> {
        Self::check_hdr_desc(hdr_desc, true)?;

        let mut pkt = Self {
            hdr_addr: hdr_desc.addr,
            // On the Rx path the header has to be filled by Firecracker. The guest only provides
            // a write-only memory area that Firecracker can write the header into. So we initialize
            // the local copy with zeros, we write to it whenever we need to, and we only commit it
            // to the guest memory once, before marking the RX descriptor chain as used.
            hdr: VsockPacketHeader::default(),
            buf_addr: None,
            buf_size: 0,
        };

        pkt.init_buf(hdr_desc, true)?;

        Ok(pkt)
    }
/// Create the packet wrapper from an RX virtq chain head.
///
/// There must be two descriptors in the chain, both writable: a header descriptor and a data
/// descriptor. Bounds and pointer checks are performed when creating the wrapper.
Create the packet wrapper from an RX virtq chain head.
There must be two descriptors in the chain, both writable: a header descriptor and a data
descriptor. Bounds and pointer checks are performed when creating the wrapper.
Create the packet wrapper from an RX virtq chain head . There must be two descriptors in the chain both writable : a header descriptor and a data descriptor . Bounds and pointer checks are performed when creating the wrapper .
pub fn from_rx_virtq_head(hdr_desc: &DescriptorChain) -> Result<Self> {
        Self::check_hdr_desc(hdr_desc, true)?;
        let mut pkt = Self {
            hdr_addr: hdr_desc.addr,
            // On the Rx path the header has to be filled by Firecracker. The guest only provides
            // a write-only memory area that Firecracker can write the header into. So we initialize
            // the local copy with zeros, we write to it whenever we need to, and we only commit it
            // to the guest memory once, before marking the RX descriptor chain as used.
            hdr: VsockPacketHeader::default(),
            buf_addr: None,
            buf_size: 0,
        };
        pkt.init_buf(hdr_desc, true)?;
        Ok(pkt)
    }
pub fn from_rx_virtq_head ( hdr_desc : & DescriptorChain ) -> Result < Self > { Self :: check_hdr_desc ( hdr_desc , true ) ? ; let mut pkt = Self { hdr_addr : hdr_desc . addr , // On the Rx path the header has to be filled by Firecracker. The guest only provides // a write-only memory area that Firecracker can write the header into. So we initialize // the local copy with zeros, we write to it whenever we need to, and we only commit it // to the guest memory once, before marking the RX descriptor chain as used. hdr : VsockPacketHeader :: default ( ) , buf_addr : None , buf_size : 0 , } ; pkt . init_buf ( hdr_desc , true ) ? ; Ok ( pkt ) }
Create the packet wrapper from an RX virtq chain head.
Create the packet wrapper from an RX virtq chain head .
hdr_desc
&DescriptorChain
hdr_desc
&DescriptorChain