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

Method shutdown

block/src/qcow/metadata.rs:249–260  ·  view source on GitHub ↗

Flushes dirty metadata caches and clears the dirty bit for clean shutdown.

(&self)

Source from the content-addressed store, hash-verified

247 /// Flushes dirty metadata caches and clears the dirty bit for
248 /// clean shutdown.
249 pub fn shutdown(&self) {
250 let mut inner = self.inner.write().unwrap();
251 let _ = inner.sync_caches();
252 let QcowState {
253 ref mut header,
254 ref mut raw_file,
255 ..
256 } = *inner;
257 if raw_file.file().is_writable() {
258 let _ = header.set_dirty_bit(raw_file.file_mut(), false);
259 }
260 }
261
262 /// Resizes the QCOW2 image to the given new size. Only grow is
263 /// supported, shrink would require walking all L2 tables to reclaim

Callers 2

dropMethod · 0.45
dropMethod · 0.45

Calls 6

is_writableMethod · 0.80
fileMethod · 0.80
set_dirty_bitMethod · 0.80
file_mutMethod · 0.80
writeMethod · 0.45
sync_cachesMethod · 0.45

Tested by

no test coverage detected