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

Method flush_table

block/src/qcow/refcount.rs:186–195  ·  view source on GitHub ↗

Flush the refcount table that keeps the address of the refcounts blocks. Returns true if the table changed since the previous `flush_table()` call.

(&mut self, raw_file: &mut QcowRawFile)

Source from the content-addressed store, hash-verified

184 /// Flush the refcount table that keeps the address of the refcounts blocks.
185 /// Returns true if the table changed since the previous `flush_table()` call.
186 pub fn flush_table(&mut self, raw_file: &mut QcowRawFile) -> io::Result<bool> {
187 if self.ref_table.dirty() {
188 raw_file
189 .write_pointer_table_direct(self.refcount_table_offset, self.ref_table.iter())?;
190 self.ref_table.mark_clean();
191 Ok(true)
192 } else {
193 Ok(false)
194 }
195 }
196
197 /// Gets the refcount for a cluster with the given address.
198 pub fn get_cluster_refcount(

Callers 2

sync_cachesMethod · 0.80
sync_cachesMethod · 0.80

Calls 4

dirtyMethod · 0.80
iterMethod · 0.80
mark_cleanMethod · 0.80

Tested by

no test coverage detected