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

Function pread_alloc

block/src/qcow_common.rs:50–54  ·  view source on GitHub ↗

Allocate a buffer and pread exactly `len` bytes at `offset`.

(fd: RawFd, offset: u64, len: usize)

Source from the content-addressed store, hash-verified

48
49/// Allocate a buffer and pread exactly `len` bytes at `offset`.
50pub fn pread_alloc(fd: RawFd, offset: u64, len: usize) -> io::Result<Vec<u8>> {
51 let mut buf = vec![0u8; len];
52 pread_exact(fd, &mut buf, offset)?;
53 Ok(buf)
54}
55
56/// Decompress a full QCOW2 cluster from compressed data.
57///

Callers 4

scatter_read_syncMethod · 0.85
read_vectoredMethod · 0.85
test_pread_allocFunction · 0.85
read_clustersMethod · 0.85

Calls 1

pread_exactFunction · 0.85

Tested by 1

test_pread_allocFunction · 0.68