Flushes dirty metadata caches and clears the dirty bit for clean shutdown.
(&self)
| 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 |
no test coverage detected