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

Method new

block/src/fixed_vhd_disk.rs:25–40  ·  view source on GitHub ↗
(file: File, use_io_uring: bool)

Source from the content-addressed store, hash-verified

23
24impl FixedVhdDisk {
25 pub fn new(file: File, use_io_uring: bool) -> BlockResult<Self> {
26 #[cfg(not(feature = "io_uring"))]
27 if use_io_uring {
28 return Err(BlockError::new(
29 BlockErrorKind::UnsupportedFeature,
30 DiskFileError::NewAsyncIo(io::Error::other(
31 "io_uring requested but feature is not enabled",
32 )),
33 ));
34 }
35
36 Ok(Self {
37 inner: FixedVhd::new(file).map_err(|e| BlockError::from(e).with_op(ErrorOp::Open))?,
38 use_io_uring,
39 })
40 }
41}
42
43impl disk_file::DiskSize for FixedVhdDisk {

Callers

nothing calls this directly

Calls 2

newFunction · 0.85
with_opMethod · 0.80

Tested by

no test coverage detected