block: Remove DiskBackend dispatch enum

All disk format backends now implement AsyncFullDiskFile directly.
The DiskBackend enum that dispatched between Legacy and Next arms
is no longer needed since the factory returns trait objects and vmm
no longer constructs format types manually.

Replace DiskBackend with Box<dyn AsyncFullDiskFile> in the Block
struct and its constructor. Remove the DiskBackend::Next wrapping
in device_manager and the fuzz target.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-04-21 22:32:58 +02:00
committed by Rob Bradford
parent 6b6150ebfc
commit 835caf9413
4 changed files with 6 additions and 91 deletions

View File

@@ -15,7 +15,6 @@ use std::path::PathBuf;
use std::sync::Arc;
use std::{ffi, io};
use block::disk_file::DiskBackend;
use block::fcntl::LockGranularityChoice;
use block::raw_sync::RawFileDiskSync;
use libfuzzer_sys::{fuzz_target, Corpus};
@@ -55,7 +54,7 @@ fuzz_target!(|bytes: &[u8]| -> Corpus {
let queue_affinity = BTreeMap::new();
let mut block = Block::new(
"tmp".to_owned(),
DiskBackend::Next(Box::new(RawFileDiskSync::new(disk_file))),
Box::new(RawFileDiskSync::new(disk_file)),
PathBuf::from(""),
false,
false,