microsoft/openvmm

Public

mirrored from https://github.com/microsoft/openvmmAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
e7ab2a78cb2ba1d35447aca97d3fc96f76e86b40

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

Guide/src/reference/backends/storage.md

53lines · modecode

1# Storage backends
2
3Storage backends implement the
4[`DiskIo`](https://openvmm.dev/rustdoc/linux/disk_backend/trait.DiskIo.html)
5trait, the shared abstraction that all storage frontends use to read
6and write data. A frontend holds a
7[`Disk`](https://openvmm.dev/rustdoc/linux/disk_backend/struct.Disk.html)
8handle and doesn't know what kind of backend is behind it — the same
9frontend code works with a local file, a Linux block device, a remote
10blob, or a layered composition of multiple backends.
11
12## Backend catalog
13
14| Backend | Crate | Wraps | Platform | Key characteristic |
15|---------|-------|-------|----------|--------------------|
16| FileDisk | [`disk_file`](https://openvmm.dev/rustdoc/linux/disk_file/index.html) | Host file | Cross-platform | Simplest backend. Blocking I/O via `unblock()`. |
17| Vhd1Disk | [`disk_vhd1`](https://openvmm.dev/rustdoc/linux/disk_vhd1/index.html) | VHD1 fixed file | Cross-platform | Parses VHD footer for geometry. |
18| VhdmpDisk | `disk_vhdmp` | Windows vhdmp driver | Windows | Dynamic and differencing VHD/VHDX. |
19| BlobDisk | [`disk_blob`](https://openvmm.dev/rustdoc/linux/disk_blob/index.html) | HTTP / Azure Blob | Cross-platform | Read-only. HTTP range requests. |
20| BlockDeviceDisk | [`disk_blockdevice`](https://openvmm.dev/rustdoc/linux/disk_blockdevice/index.html) | Linux block device | Linux | io_uring, resize via uevent, PR passthrough. |
21| NvmeDisk | [`disk_nvme`](https://openvmm.dev/rustdoc/linux/disk_nvme/index.html) | Physical NVMe (VFIO) | Linux/Windows | User-mode NVMe driver. Resize via AEN. |
22| StripedDisk | [`disk_striped`](https://openvmm.dev/rustdoc/linux/disk_striped/index.html) | Multiple Disks | Cross-platform | Stripes data across underlying disks. |
23
24## Decorators
25
26Decorators wrap another
27[`Disk`](https://openvmm.dev/rustdoc/linux/disk_backend/struct.Disk.html)
28and transform I/O in transit. Features compose by stacking decorators
29without modifying the backends underneath.
30
31| Decorator | Crate | Transform |
32|-----------|-------|-----------|
33| CryptDisk | [`disk_crypt`](https://openvmm.dev/rustdoc/linux/disk_crypt/index.html) | XTS-AES-256 encryption. Encrypts on write, decrypts on read. |
34| DelayDisk | [`disk_delay`](https://openvmm.dev/rustdoc/linux/disk_delay/index.html) | Adds configurable latency to each I/O operation. |
35| DiskWithReservations | [`disk_prwrap`](https://openvmm.dev/rustdoc/linux/disk_prwrap/index.html) | In-memory SCSI persistent reservation emulation. |
36
37## Layered disks
38
39A [`LayeredDisk`](https://openvmm.dev/rustdoc/linux/disk_layered/index.html)
40composes multiple layers into a single `DiskIo` implementation. Each
41layer tracks which sectors it has; reads fall through from top to
42bottom until a layer has the requested data. This powers the
43`memdiff:` and `mem:` CLI options.
44
45Two layer implementations exist today:
46
47- **RamDiskLayer** ([`disklayer_ram`](https://openvmm.dev/rustdoc/linux/disklayer_ram/index.html)) — ephemeral, in-memory.
48- **SqliteDiskLayer** ([`disklayer_sqlite`](https://openvmm.dev/rustdoc/linux/disklayer_sqlite/index.html)) — persistent, file-backed (dev/test only).
49
50The [storage pipeline](../architecture/devices/storage.md) page covers
51the full architecture: how frontends, backends, decorators, and the
52layered disk model connect, plus cross-cutting concerns like online
53disk resize and virtual optical media.
54