Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/vmm/src/devices/virtio/vsock/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
9 changes: 7 additions & 2 deletions src/vmm/src/devices/virtio/vsock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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,
Expand Down