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

Method open_backing_file

vmm/src/memory_manager.rs:1882–1898  ·  view source on GitHub ↗
(
        backing_file: &PathBuf,
        file_offset: u64,
        shared: bool,
    )

Source from the content-addressed store, hash-verified

1880 }
1881
1882 fn open_backing_file(
1883 backing_file: &PathBuf,
1884 file_offset: u64,
1885 shared: bool,
1886 ) -> Result<FileOffset, Error> {
1887 if backing_file.is_dir() {
1888 Err(Error::DirectoryAsBackingFileForMemory)
1889 } else {
1890 let f = OpenOptions::new()
1891 .read(true)
1892 .write(shared)
1893 .open(backing_file)
1894 .map_err(Error::SharedFileCreate)?;
1895
1896 Ok(FileOffset::new(f, file_offset))
1897 }
1898 }
1899
1900 #[allow(clippy::too_many_arguments)]
1901 pub fn create_ram_region_raw(

Callers

nothing calls this directly

Calls 4

newFunction · 0.85
openMethod · 0.80
writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected