Skip to main content

Crate virtio_spec

Crate virtio_spec 

Source
Expand description

This crate contains the Rust equivalents of the definitions from the Virtual I/O Device (VIRTIO) Specification. This crate aims to be unopinionated regarding actual VIRTIO drivers that are implemented on top of this crate.

§Usage

We recommend to rename this crate to virtio when adding the dependency. This allows closely matching the specification when using definitions:

Either run

cargo add virtio-spec --rename virtio

or manually edit your Cargo.toml:

[dependencies]
virtio = { package = "virtio-spec", version = "x.y.z" }

§Features

This crate has the following Cargo features:

§Implementation Status

This crate adds new modules by demand. If you need anything that is not available yet, please open an issue.

§Virtqueues

VirtqueueAvailableModule
Split Virtqueues✅virtq
Packed Virtqueues✅pvirtq

§Transport Options

Transport OptionAvailableModule
PCI Bus✅pci
MMIO✅mmio
Channel I/O❌

§Device Types

Device TypeAvailableModule
Network Device✅net
Block Device✅blk
Console Device✅console
Entropy Device✅None required
Traditional Memory Balloon Device✅balloon
SCSI Host Device❌
GPU Device❌
Input Device❌
Crypto Device❌
Socket Device✅vsock
File System Device✅fs
RPMB Device❌
IOMMU Device❌
Sound Device❌
Memory Device❌
I2C Adapter Device❌
SCMI Device❌
GPIO Device❌
PMEM Device❌

Modules§

balloon
Traditional Memory Balloon Device
blk
Block Device
console
Console Device
fs
File System Device
mmiommio
Definitions for Virtio over MMIO.
net
Network Device
pcipci
Definitions for Virtio over PCI bus.
pvirtq
Packed virtqueue definitions
virtq
Virtqueue definitions
volatile
Volatile Pointer Types.
vsock
Socket Device

Structs§

Be
An integer stored in big-endian byte order.
DeviceStatus
Device Status Field
F
Device-independent Feature Bits
Le
An integer stored in little-endian byte order.

Enums§

Id
Virtio Device IDs
RingEventFlags
Descriptor Ring Change Event Flags

Traits§

DeviceConfigSpace
Common device configuration space functionality.
FeatureBits
Feature Bits

Type Aliases§

be16linux-types
A 16-bit unsigned integer stored in big-endian byte order.
be32linux-types
A 32-bit unsigned integer stored in big-endian byte order.
be64linux-types
A 64-bit unsigned integer stored in big-endian byte order.
be128linux-types
A 128-bit unsigned integer stored in big-endian byte order.
le16linux-types
A 16-bit unsigned integer stored in little-endian byte order.
le32linux-types
A 32-bit unsigned integer stored in little-endian byte order.
le64linux-types
A 64-bit unsigned integer stored in little-endian byte order.
le128linux-types
A 128-bit unsigned integer stored in little-endian byte order.