mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
committed by
Rob Bradford
parent
6b6150ebfc
commit
835caf9413
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user