Module virtio

Source
Expand description

Implements virtio devices, queues, and transport mechanisms.

Re-exportsΒ§

pub use self::block::BlockAsync;
pub use self::console::Console;
pub use self::gpu::DisplayBackend;
pub use self::gpu::Gpu;
pub use self::gpu::GpuMode;
pub use self::gpu::GpuParameters;
pub use self::gpu::GpuWsi;
pub use self::net::Net;
pub use self::net::NetError;
pub use self::net::NetParameters;
pub use self::net::NetParametersMode;
pub use self::scsi::Controller as ScsiController;
pub use self::scsi::DiskConfig as ScsiDiskConfig;
pub use self::vhost_user_frontend::VhostUserFrontend;
pub use self::DeviceType::Pvclock;
pub use self::net::VhostNetParameters;
pub use self::net::VHOST_NET_DEFAULT_PATH;
pub use self::snd::new_sound;
pub use self::wl::Wl;

ModulesΒ§

async_utils πŸ”’
Virtio device async helper functions.
balloon πŸ”’
block
console
Virtio console device.
descriptor_chain πŸ”’
Virtqueue descriptor chain abstraction
descriptor_utils πŸ”’
device_constants
Contains constants and struct definitions used for implementing vhost-user frontend devices without compile-time dependencies on their corresponding backend devices.
fs
gpu
input
interrupt πŸ”’
iommu πŸ”’
ipc_memory_mapper
Provide utility to communicate with an iommu in another process
media
Support for virtio-media devices in crosvm.
memory_mapper
MemoryMapper trait and basic impl for virtio-iommu implementation
net
p9 πŸ”’
pmem πŸ”’
pvclock
Virtio version of a linux pvclock clocksource.
queue πŸ”’
virtqueue interface
resource_bridge
This module defines the protocol between virtio-wayland and virtio-gpu for sharing resources that are backed by file descriptors.
rng πŸ”’
scsi
snd
tpm πŸ”’
vfio_wrapper
Wraps VfioContainer for virtio-iommu implementation
vhost
Implements vhost-based virtio devices.
vhost_user_backend
vhost_user_frontend
VirtioDevice implementation for the VMM side of a vhost-user connection.
video πŸ”’
This module implements the virtio video encoder and decoder devices. The current implementation uses v3 RFC of the virtio-video protocol.
virtio_device πŸ”’
virtio_mmio_device πŸ”’
virtio_pci_common_config πŸ”’
virtio_pci_device πŸ”’
vsock
This module implements the virtio vsock device.
wl
This module implements the virtio wayland used by the guest to access the host’s wayland server.

StructsΒ§

Balloon
Virtio device for memory balloon inflation/deflation.
Desc
A single virtio split queue descriptor (struct virtq_desc in the spec).
DescriptorChain
A virtio descriptor chain.
GpuDisplayParameters
Interrupt
InterruptSnapshot
Iommu
Virtio device for IOMMU memory management.
P9
Virtio device for sharing specific directories on the host system with the guest VM.
PeekedDescriptorChain
A DescriptorChain that has been peeked from a Queue but not popped yet.
Pmem
PmemConfig
Configuration of a virtio-pmem device.
QueueConfig
A virtio queue’s parameters.
Reader
Provides high-level interface over the sequence of memory regions defined by readable descriptors in the descriptor chain.
Rng
Virtio device for exposing entropy to the guest OS through virtio.
SharedMemoryRegion
SplitDescriptorChain
Iterator over the descriptors of a split virtqueue descriptor chain.
Tpm
Virtio vTPM device.
VideoDevice
VirtioMmioDevice
Implements the MMIO transport for virtio devices.
VirtioPciCap
VirtioPciDevice
Implements the PCI transport for virtio devices.
VirtioPciShmCap
Writer
Provides high-level interface over the sequence of memory regions defined by writable descriptors in the descriptor chain.

EnumsΒ§

BalloonFeatures
DescriptorType
DeviceType
GpuDisplayMode
GpuMouseMode
IommuError
MemSlotConfig
Specifies how memory slot is initialized.
PciCapabilityType
Queue
Virtqueue interface representing different types of virtqueues The struct of each queue type is wrapped in the enum variants
SharedMemoryPrepareType
Type of Virtio device memory mapping to use.
StoppedWorker πŸ”’
When we request to stop the worker, this represents the terminal state for the thread (if it exists).
VirtioDeviceType
Type of virtio transport.

ConstantsΒ§

DEVICE_RESET πŸ”’
INTERRUPT_STATUS_CONFIG_CHANGED πŸ”’
INTERRUPT_STATUS_USED_RING πŸ”’
VIRTIO_MSI_NO_VECTOR πŸ”’

TraitsΒ§

DescriptorChainIter
Iterator over the descriptors of a descriptor chain.
SharedMemoryMapper
Trait for mapping memory into the device’s shared memory region.
TpmBackend
VirtioDevice
Trait for virtio devices to be driven by a virtio transport.

FunctionsΒ§

base_features
Returns the set of reserved base features common to all virtio devices.
copy_config
Copy virtio device configuration data from a subslice of src to a subslice of dst. Unlike std::slice::copy_from_slice(), this function copies as much as possible within the common subset of the two slices, truncating the requested range instead of panicking if the slices do not match in size.
create_descriptor_chain
Test utility function to create a descriptor chain in guest memory.
create_stop_oneshot πŸ”’
Creates a oneshot channel, returning the rx end and adding the tx end to the provided Vec. Useful for creating oneshots that signal a virtqueue future to stop processing and exit.