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

Method append_data_cluster

block/src/qcow/mod.rs:1622–1627  ·  view source on GitHub ↗

Allocate and initialize a new data cluster. Returns the offset of the cluster into the file on success.

(&mut self, initial_data: Option<Vec<u8>>)

Source from the content-addressed store, hash-verified

1620 // Allocate and initialize a new data cluster. Returns the offset of the
1621 // cluster into the file on success.
1622 fn append_data_cluster(&mut self, initial_data: Option<Vec<u8>>) -> std::io::Result<u64> {
1623 let new_addr: u64 = self.get_new_cluster(initial_data)?;
1624 // The cluster refcount starts at one indicating it is used but doesn't need COW.
1625 self.set_cluster_refcount_track_freed(new_addr, 1)?;
1626 Ok(new_addr)
1627 }
1628
1629 // Returns true if the cluster containing `address` is already allocated.
1630 fn cluster_allocated(&mut self, address: u64) -> std::io::Result<bool> {

Callers 1

file_offset_writeMethod · 0.45

Calls 2

get_new_clusterMethod · 0.45

Tested by

no test coverage detected