virtio-devices: vmm: fuzz: Switch to DiskBackend

Change Block to hold DiskBackend instead of
Box<dyn async_io::DiskFile>. In device_manager, existing formats
(raw, vhd, vhdx) are wrapped in DiskBackend::Legacy while
QcowDiskSync uses DiskBackend::Next. The fuzz target is updated
accordingly.

The Error::DiskResize variant now carries BlockError instead of
DiskFileError, matching the BlockResult return type of
DiskBackend::resize().

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-03-12 23:51:58 +01:00
committed by Rob Bradford
parent 264013b424
commit b4dad66d35
3 changed files with 24 additions and 16 deletions

View File

@@ -16,6 +16,7 @@ use std::sync::Arc;
use std::{ffi, io};
use block::async_io::DiskFile;
use block::disk_file::DiskBackend;
use block::fcntl::LockGranularityChoice;
use block::raw_sync::RawFileDiskSync;
use libfuzzer_sys::{fuzz_target, Corpus};
@@ -56,7 +57,7 @@ fuzz_target!(|bytes: &[u8]| -> Corpus {
let queue_affinity = BTreeMap::new();
let mut block = Block::new(
"tmp".to_owned(),
qcow_disk,
DiskBackend::Legacy(qcow_disk),
PathBuf::from(""),
false,
false,