MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / open_fixed_vhd

Function open_fixed_vhd

block/src/factory.rs:121–140  ·  view source on GitHub ↗
(
    file: fs::File,
    options: &DiskOpenOptions<'_>,
)

Source from the content-addressed store, hash-verified

119}
120
121fn open_fixed_vhd(
122 file: fs::File,
123 options: &DiskOpenOptions<'_>,
124) -> BlockResult<Box<dyn AsyncFullDiskFile>> {
125 #[cfg(feature = "io_uring")]
126 if !options.disable_io_uring {
127 if io_uring_supported() {
128 info!("Opening fixed VHD disk file with io_uring backend");
129 return Ok(Box::new(
130 FixedVhdDisk::new(file, true).map_err(|e| e.with_path(options.path))?,
131 ));
132 }
133 info!("io_uring runtime probe failed for fixed VHD, using synchronous backend");
134 }
135
136 info!("Opening fixed VHD disk file with synchronous backend");
137 Ok(Box::new(
138 FixedVhdDisk::new(file, false).map_err(|e| e.with_path(options.path))?,
139 ))
140}
141
142fn open_raw(
143 file: fs::File,

Callers 1

open_diskFunction · 0.85

Calls 3

io_uring_supportedFunction · 0.85
newFunction · 0.85
with_pathMethod · 0.80

Tested by

no test coverage detected