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

Method write_cluster

block/src/qcow/qcow_raw_file.rs:335–339  ·  view source on GitHub ↗

Writes

(&mut self, address: u64, data: &[u8])

Source from the content-addressed store, hash-verified

333
334 /// Writes
335 pub fn write_cluster(&mut self, address: u64, data: &[u8]) -> io::Result<()> {
336 let cluster_size = self.cluster_size as usize;
337 self.file.seek(SeekFrom::Start(address))?;
338 self.file.write_all(&data[0..cluster_size])
339 }
340
341 pub fn physical_size(&self) -> Result<u64, std::io::Error> {
342 self.file.metadata().map(|m| m.len())

Callers 2

get_new_clusterMethod · 0.80
get_new_clusterMethod · 0.80

Calls 1

seekMethod · 0.45

Tested by

no test coverage detected