diff --git a/src/vmm/src/devices/virtio/vsock/device.rs b/src/vmm/src/devices/virtio/vsock/device.rs index 7fe10d158ad..83e23fe7545 100644 --- a/src/vmm/src/devices/virtio/vsock/device.rs +++ b/src/vmm/src/devices/virtio/vsock/device.rs @@ -54,8 +54,9 @@ pub(crate) const VIRTIO_VSOCK_EVENT_TRANSPORT_RESET: u32 = 0; /// - VIRTIO_F_VERSION_1: the device conforms to at least version 1.0 of the VirtIO spec. /// - VIRTIO_F_IN_ORDER: the device returns used buffers in the same order that the driver makes /// them available. -pub(crate) const AVAIL_FEATURES: u64 = - (1 << VIRTIO_F_VERSION_1 as u64) | (1 << VIRTIO_F_IN_ORDER as u64); +pub(crate) const AVAIL_FEATURES: u64 = (1 << VIRTIO_F_VERSION_1 as u64) + | (1 << VIRTIO_F_IN_ORDER as u64) + | (1 << (uapi::VIRTIO_VSOCK_F_SEQPACKET as u64)); /// Structure representing the vsock device. #[derive(Debug)] diff --git a/src/vmm/src/devices/virtio/vsock/mod.rs b/src/vmm/src/devices/virtio/vsock/mod.rs index cc9f7746580..269b33c9b9d 100644 --- a/src/vmm/src/devices/virtio/vsock/mod.rs +++ b/src/vmm/src/devices/virtio/vsock/mod.rs @@ -84,8 +84,13 @@ mod defs { /// Vsock packet type. /// Defined in `/include/uapi/linux/virtio_vsock.h`. /// - /// Stream / connection-oriented packet (the only currently valid type). + /// Stream / connection-oriented packet. pub const VSOCK_TYPE_STREAM: u16 = 1; + /// Sequenced packet (record preserving) socket type. + pub const VSOCK_TYPE_SEQPACKET: u16 = 2; + + /// Virtio vsock feature bits. + pub const VIRTIO_VSOCK_F_SEQPACKET: u16 = 1; pub const VSOCK_HOST_CID: u64 = 2; } @@ -95,7 +100,7 @@ mod defs { #[derive(Debug, thiserror::Error, displaydoc::Display)] #[rustfmt::skip] pub enum VsockError { - /** The total length of the descriptor chain ({0}) is too short to hold a packet of length {1} + header */ + /** Descriptor chain ({0}) shorter than packet len {1} + header */ DescChainTooShortForPacket(u32, u32), /// Empty queue EmptyQueue,