[WIP] vhdx: add pure-Rust VHDX parser and disk layer#3347
Draft
jstarks wants to merge 1 commit intomicrosoft:mainfrom
Draft
[WIP] vhdx: add pure-Rust VHDX parser and disk layer#3347jstarks wants to merge 1 commit intomicrosoft:mainfrom
jstarks wants to merge 1 commit intomicrosoft:mainfrom
Conversation
jstarks
commented
Apr 21, 2026
|
This PR modifies files containing For more on why we check whole files, instead of just diffs, check out the Rustonomicon |
jstarks
commented
Apr 21, 2026
jstarks
commented
Apr 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a cross-platform, pure-Rust VHDX implementation (parser + read/write + WAL pipeline) and wires it into OpenVMM’s layered disk stack so .vhdx works without the Windows-only kernel driver.
Changes:
- Introduces a new
vhdxcrate with VHDX format parsing, metadata/region/header handling, and a WAL-backed commit/apply pipeline. - Adds a new
disklayer_vhdxcrate implementingLayerIo+ resolver, including parent-locator chain walking. - Updates OpenVMM resource registration and disk-opening logic to use the new VHDX backend for
.vhdx.
Reviewed changes
Copilot reviewed 34 out of 41 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| vm/devices/storage/vhdx/src/sector_bitmap.rs | Sector bitmap cache + partially-present read resolution; adds unit tests. |
| vm/devices/storage/vhdx/src/region.rs | Region table parsing/validation + rewrite via WAL; adds tests. |
| vm/devices/storage/vhdx/src/metadata.rs | Metadata table parsing + item reads; adds tests. |
| vm/devices/storage/vhdx/src/lsn_watermark.rs | Async LSN/FSN watermark primitive with poisoning + tests. |
| vm/devices/storage/vhdx/src/log_task.rs | WAL logging task plumbing and tail advancement + tests. |
| vm/devices/storage/vhdx/src/log_permits.rs | Failable semaphore for pipeline backpressure + tests. |
| vm/devices/storage/vhdx/src/locator.rs | Parent locator parsing (UTF-16 KV table) + tests. |
| vm/devices/storage/vhdx/src/lib.rs | Crate root + module exports + AsyncFile trait. |
| vm/devices/storage/vhdx/src/known_meta.rs | Parses well-known metadata items + required-item validation + tests. |
| vm/devices/storage/vhdx/src/header.rs | Dual-header parsing + serialized header updates + tests. |
| vm/devices/storage/vhdx/src/format.rs | On-disk structs/constants + checksums + GUIDs + layout tests. |
| vm/devices/storage/vhdx/src/flush.rs | Flush sequencer implementation + tests. |
| vm/devices/storage/vhdx/src/error.rs | Error and corruption enums used across the crate. |
| vm/devices/storage/vhdx/src/create.rs | VHDX creation logic (headers/regions/metadata/BAT) + tests. |
| vm/devices/storage/vhdx/src/apply_task.rs | Apply task writing logged pages to final offsets. |
| vm/devices/storage/vhdx/Cargo.toml | Defines the new vhdx crate and dependencies. |
| vm/devices/storage/disklayer_vhdx/src/resolver.rs | Resource resolver for VhdxDiskLayerHandle. |
| vm/devices/storage/disklayer_vhdx/src/lib.rs | LayerIo implementation bridging vhdx ranges to buffers. |
| vm/devices/storage/disklayer_vhdx/src/io.rs | BlockingFile implementing vhdx::AsyncFile via blocking pool. |
| vm/devices/storage/disklayer_vhdx/src/chain.rs | Helpers to open single VHDX or auto-walk differencing chains. |
| vm/devices/storage/disklayer_vhdx/Cargo.toml | Defines the new disklayer crate + deps/tests. |
| vm/devices/storage/disk_backend_resources/src/layer.rs | Adds VhdxDiskLayerHandle resource type. |
| openvmm/openvmm_resources/src/lib.rs | Registers the new VHDX disklayer resolver. |
| openvmm/openvmm_resources/Cargo.toml | Adds disklayer_vhdx dependency. |
| openvmm/openvmm_helpers/src/disk.rs | Routes .vhdx open to the pure-Rust VHDX chain implementation. |
| openvmm/openvmm_helpers/Cargo.toml | Adds disklayer_vhdx dependency. |
| Cargo.toml | Adds workspace members + crc32c dependency. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a pure-Rust VHDX implementation with full read/write support, write-ahead logging, crash consistency, free space management, trim, differencing disk chains, and a disk_backend integration layer.
This allows non-Windows hosts to use VHDX files.