pub fn send_transport_reset_event(&mut self) -> result::Result<(), DeviceError> {
        // This is safe since we checked in the caller function that the device is activated.
        let mem = self.device_state.mem().unwrap();

        let head = self.queues[EVQ_INDEX].pop(mem).ok_or_else(|| {
            METRICS.vsock.ev_queue_event_fails.inc();
            DeviceError::VsockError(VsockError::EmptyQueue)
        })?;

        mem.write_obj::<u32>(VIRTIO_VSOCK_EVENT_TRANSPORT_RESET, head.addr)
            .unwrap_or_else(|e| error!("Failed to write virtio vsock reset event: {:?}", e));

        self.queues[EVQ_INDEX]
            .add_used(mem, head.index, head.len)
            .unwrap_or_else(|e| {
                error!("Failed to add used descriptor {}: {}", head.index, e);
            });

        self.signal_used_queue()?;

        Ok(())
    }
// Send TRANSPORT_RESET_EVENT to driver. According to specs, the driver shuts down established
// connections and the guest_cid configuration field is fetched again. Existing listen sockets remain
// but their CID is updated to reflect the current guest_cid.
Send TRANSPORT_RESET_EVENT to driver. According to specs, the driver shuts down established
connections and the guest_cid configuration field is fetched again. Existing listen sockets remain
but their CID is updated to reflect the current guest_cid.
Send TRANSPORT_RESET_EVENT to driver . According to specs the driver shuts down established connections and the guest_cid configuration field is fetched again . Existing listen sockets remain but their CID is updated to reflect the current guest_cid .
pub fn send_transport_reset_event(&mut self) -> result::Result<(), DeviceError> {
        // This is safe since we checked in the caller function that the device is activated.
        let mem = self.device_state.mem().unwrap();
        let head = self.queues[EVQ_INDEX].pop(mem).ok_or_else(|| {
            METRICS.vsock.ev_queue_event_fails.inc();
            DeviceError::VsockError(VsockError::EmptyQueue)
        })?;
        mem.write_obj::<u32>(VIRTIO_VSOCK_EVENT_TRANSPORT_RESET, head.addr)
            .unwrap_or_else(|e| error!("Failed to write virtio vsock reset event: {:?}", e));
        self.queues[EVQ_INDEX]
            .add_used(mem, head.index, head.len)
            .unwrap_or_else(|e| {
                error!("Failed to add used descriptor {}: {}", head.index, e);
            });
        self.signal_used_queue()?;
        Ok(())
    }
pub fn send_transport_reset_event ( & mut self ) -> result :: Result < ( ) , DeviceError > { // This is safe since we checked in the caller function that the device is activated. let mem = self . device_state . mem ( ) . unwrap ( ) ; let head = self . queues [ EVQ_INDEX ] . pop ( mem ) . ok_or_else ( | | { METRICS . vsock . ev_queue_event_fails . inc ( ) ; DeviceError :: VsockError ( VsockError :: EmptyQueue ) } ) ? ; mem . write_obj :: < u32 > ( VIRTIO_VSOCK_EVENT_TRANSPORT_RESET , head . addr ) . unwrap_or_else ( | e | error ! ( " " e ) ) ; self . queues [ EVQ_INDEX ] . add_used ( mem , head . index , head . len ) . unwrap_or_else ( | e | { error ! ( " " head index e ) ; } ) ; self . signal_used_queue ( ) ? ; Ok ( ( ) ) }
Send TRANSPORT_RESET_EVENT to driver.
Send TRANSPORT_RESET_EVENT to driver .
&mut self
&mut self