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

Method clear_autoclear_features

block/src/qcow/header.rs:571–583  ·  view source on GitHub ↗

Clear all autoclear feature bits for QCOW2 v3 images. These bits indicate features that can be safely disabled when modified by software that doesn't understand them.

(
        &mut self,
        file: &mut F,
    )

Source from the content-addressed store, hash-verified

569 /// These bits indicate features that can be safely disabled when modified
570 /// by software that doesn't understand them.
571 pub fn clear_autoclear_features<F: Seek + Write + FileSync>(
572 &mut self,
573 file: &mut F,
574 ) -> Result<()> {
575 if self.version == 3 && self.autoclear_features != 0 {
576 self.autoclear_features = 0;
577 file.seek(SeekFrom::Start(AUTOCLEAR_FEATURES_OFFSET))
578 .map_err(Error::WritingHeader)?;
579 u64::write_be(file, 0).map_err(Error::WritingHeader)?;
580 file.fsync().map_err(Error::SyncingHeader)?;
581 }
582 Ok(())
583 }
584}
585
586pub(super) fn max_refcount_clusters(

Callers 1

parse_qcowFunction · 0.80

Calls 2

seekMethod · 0.45
fsyncMethod · 0.45

Tested by

no test coverage detected