Skip to content

Replace redundant test disk implementations with RAM disk backend#2995

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/remove-redundant-test-disks
Draft

Replace redundant test disk implementations with RAM disk backend#2995
Copilot wants to merge 3 commits intomainfrom
copilot/remove-redundant-test-disks

Conversation

Copy link
Contributor

Copilot AI commented Mar 13, 2026

Now that disklayer_ram supports custom sector sizes (RamDiskLayer::new_with_sector_size, ram_disk_with_sector_size), two custom DiskIo test implementations that existed as workarounds can be removed.

virtio_blk — remove TestDisk4K

TestDisk4K was explicitly documented as a workaround for non-512-byte sector testing. Replaced with disklayer_ram::ram_disk_with_sector_size(). The with_discard() variant is also eliminated since the RAM disk already returns UnmapBehavior::Unspecified.

Removed dev-dependencies: parking_lot. Removed unused imports: DiskError, DiskIo, Inspect, MemoryRead, MemoryWrite.

scsidisk/scsidvd — remove local TestDisk

The test module had its own TestDisk that pre-seeded sector data for read tests. Replaced with a RAM disk, pre-filled synchronously via now_or_never() before constructing SimpleScsiDvd:

fn new_scsi_dvd(sector_size: u32, sector_count: u64) -> SimpleScsiDvd {
    let disk = disklayer_ram::ram_disk_with_sector_size(disk_size, false, sector_size).unwrap();
    // Pre-fill pattern data synchronously — RAM disk ops never block
    disk.write_vectored(&buffers.buffer(&mem), 0, false)
        .now_or_never()
        .expect("RAM disk write should complete synchronously")
        .unwrap();
    SimpleScsiDvd::new(Some(disk))
}

The read_only parameter was dropped (all callers passed true; the underlying disk must be writable for pre-fill, and DVD write protection is enforced at the SCSI layer).

Added disklayer_ram to scsidisk dev-dependencies.


Not changed: scsidisk/tests/test_helpers.rs TestDisk — retained because it provides FUA tracking, dynamic sector-count mutation for resize tests, and asymmetric physical/logical sector sizes, none of which the RAM disk backend exposes.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /home/REDACTED/work/openvmm/openvmm/flowey-out/.work/flowey_lib_common__download_gh_cli_0/gh /home/REDACTED/work/openvmm/openvmm/flowey-out/.work/flowey_lib_common__download_gh_cli_0/gh auth status lib/rustlib/x86_--force-confdef lib/�� lib/rustlib/x86_--force-confdef 7.1/protoc-27.1---force-confold lib/rustlib/x86_--force-confdef lib/rustlib/x86_/usr/lib/apt/apt-helper lib/rustlib/x86_cat-file lib/rustlib/x86_/var/lib/apt/lists/_etc_apt_apt-mirrors.txt_dists_noble-updates_universe_cnf_Commands-amd64 lib/rustlib/x86_/home/REDACTED/work/openvmm/openvmm/target/debug/deps/flowey_hvlite-5fdf6367a03a8923.3c88f6jnz3zmbm8b32h2qcema.07auqfv.rcgu.o lib/�� lib/rustlib/x86_64-REDACTED-linux-gnu/lib/librustc_std_workspace_alloc-1aa74596e1d30fe3.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libminiz_oxide-92023c1cb0992e10.rlib known-linux-gnu/lib/rustlib/x86_64-REDACTED-linux-gnu/bin/self-contained/cc 6fwngbj61cz7xjh./usr/bin/dpkg 6a.rlib known-linux-gnu/--force-confold known-linux-gnu/--force-confdef (http block)
  • https://api.github.com/repos/microsoft/openvmm/actions/workflows/openvmm-ci.yaml
    • Triggering command: /home/REDACTED/work/openvmm/openvmm/flowey-out/.work/flowey_lib_common__download_gh_cli_0/gh /home/REDACTED/work/openvmm/openvmm/flowey-out/.work/flowey_lib_common__download_gh_cli_0/gh run list -R microsoft/openvmm -b release/1.7.2511 -w openvmm-ci.yaml -s success --limit 1 --json databaseId -q .[0].databaseId 6a.rlib known-linux-gnu/--force-confold known-linux-gnu/--force-confdef (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Redundant test disk implementations</issue_title>
<issue_description>Now that #2927 is done, the RAM disk backend can handle multiple sector sizes. Some test code around the tree was using its own mock disk implementation to work around this missing functionality. Search for such code and replace it with the RAM disk backend.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI and others added 2 commits March 13, 2026 23:52
Co-authored-by: jstarks <9548354+jstarks@users.noreply.github.com>
Co-authored-by: jstarks <9548354+jstarks@users.noreply.github.com>
Copilot AI changed the title [WIP] [openvmm-2927] Remove redundant test disk implementations Replace redundant test disk implementations with RAM disk backend Mar 13, 2026
Copilot AI requested a review from jstarks March 13, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redundant test disk implementations

2 participants