Skip to content

Latest commit

 

History

History
54 lines (43 loc) · 3.47 KB

storage.md

File metadata and controls

54 lines (43 loc) · 3.47 KB

Storage backends

Storage backends implement the DiskIo trait, the shared abstraction that all storage frontends use to read and write data. A frontend holds a Disk handle and doesn't know what kind of backend is behind it — the same frontend code works with a local file, a Linux block device, a remote blob, or a layered composition of multiple backends.

Backend catalog

Backend Crate Wraps Platform Key characteristic
FileDisk disk_file Host file Cross-platform Simplest backend. Blocking I/O via unblock().
Vhd1Disk disk_vhd1 VHD1 fixed file Cross-platform Parses VHD footer for geometry.
VhdmpDisk disk_vhdmp Windows vhdmp driver Windows Dynamic and differencing VHD/VHDX.
VhdxDisk vhdx VHDX file Cross-platform Pure-Rust VHDX parser. Dynamic, fixed, and differencing.
BlobDisk disk_blob HTTP / Azure Blob Cross-platform Read-only. HTTP range requests.
BlockDeviceDisk disk_blockdevice Linux block device or file Linux io_uring, resize via uevent, PR passthrough. Default for raw files on Linux in both OpenHCL and OpenVMM.
NvmeDisk disk_nvme Physical NVMe (VFIO) Linux/Windows User-mode NVMe driver. Resize via AEN.
StripedDisk disk_striped Multiple Disks Cross-platform Stripes data across underlying disks.

Decorators

Decorators wrap another Disk and transform I/O in transit. Features compose by stacking decorators without modifying the backends underneath.

Decorator Crate Transform
CryptDisk disk_crypt XTS-AES-256 encryption. Encrypts on write, decrypts on read.
DelayDisk disk_delay Adds configurable latency to each I/O operation.
DiskWithReservations disk_prwrap In-memory SCSI persistent reservation emulation.

Layered disks

A LayeredDisk composes multiple layers into a single DiskIo implementation. Each layer tracks which sectors it has; reads fall through from top to bottom until a layer has the requested data. This powers the memdiff: and mem: CLI options.

Two layer implementations exist today:

The storage pipeline page covers the full architecture: how frontends, backends, decorators, and the layered disk model connect, plus cross-cutting concerns like online disk resize and virtual optical media.