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-waylandandvirtio-gpufor 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_descin the spec). - Descriptor
Chain - A virtio descriptor chain.
- GpuDisplay
Parameters - Interrupt
- Interrupt
Snapshot - Iommu
- Virtio device for IOMMU memory management.
- P9
- Virtio device for sharing specific directories on the host system with the guest VM.
- Peeked
Descriptor Chain - A
DescriptorChainthat has been peeked from aQueuebut not popped yet. - Pmem
- Pmem
Config - Configuration of a virtio-pmem device.
- Queue
Config - 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.
- Shared
Memory Region - Split
Descriptor Chain - Iterator over the descriptors of a split virtqueue descriptor chain.
- Tpm
- Virtio vTPM device.
- Video
Device - Virtio
Mmio Device - Implements the MMIO transport for virtio devices.
- Virtio
PciCap - Virtio
PciDevice - Implements the PCI transport for virtio devices.
- Virtio
PciShm Cap - Writer
- Provides high-level interface over the sequence of memory regions defined by writable descriptors in the descriptor chain.
EnumsΒ§
- Balloon
Features - Descriptor
Type - Device
Type - GpuDisplay
Mode - GpuMouse
Mode - Iommu
Error - MemSlot
Config - Specifies how memory slot is initialized.
- PciCapability
Type - Queue
- Virtqueue interface representing different types of virtqueues The struct of each queue type is wrapped in the enum variants
- Shared
Memory Prepare Type - Type of Virtio device memory mapping to use.
- Stopped
Worker π - When we request to stop the worker, this represents the terminal state for the thread (if it exists).
- Virtio
Device Type - Type of virtio transport.
ConstantsΒ§
- DEVICE_
RESET π - INTERRUPT_
STATUS_ πCONFIG_ CHANGED - INTERRUPT_
STATUS_ πUSED_ RING - VIRTIO_
MSI_ πNO_ VECTOR
TraitsΒ§
- Descriptor
Chain Iter - Iterator over the descriptors of a descriptor chain.
- Shared
Memory Mapper - Trait for mapping memory into the deviceβs shared memory region.
- TpmBackend
- Virtio
Device - 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
srcto a subslice ofdst. 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.