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

Method map_cluster_for_write

block/src/qcow/metadata.rs:230–237  ·  view source on GitHub ↗

Maps a guest write address to a write mapping. Always takes a write lock since writes may need to allocate clusters, update L2 entries and update refcounts. The backing_data parameter is the COW source. If the cluster is unallocated and a backing file exists, the caller should have already read the backing cluster data and pass it here. If None, the new cluster is zeroed.

(
        &self,
        address: u64,
        backing_data: Option<Vec<u8>>,
    )

Source from the content-addressed store, hash-verified

228 /// read the backing cluster data and pass it here. If None, the new
229 /// cluster is zeroed.
230 pub fn map_cluster_for_write(
231 &self,
232 address: u64,
233 backing_data: Option<Vec<u8>>,
234 ) -> io::Result<ClusterWriteMapping> {
235 let mut inner = self.inner.write().unwrap();
236 inner.map_write(address, backing_data)
237 }
238
239 pub fn flush(&self) -> io::Result<()> {
240 let mut inner = self.inner.write().unwrap();

Callers 2

cow_write_syncMethod · 0.80
write_vectoredMethod · 0.80

Calls 2

map_writeMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected