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

Function rebuild_refcounts

block/src/qcow/mod.rs:3971–3981  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3969
3970 #[test]
3971 fn rebuild_refcounts() {
3972 with_basic_file(&valid_header_v3(), |mut disk_file: RawFile| {
3973 let header = QcowHeader::new(&mut disk_file).expect("Failed to create Header.");
3974 let cluster_size = 65536;
3975 let refcount_bits = 1u64 << header.refcount_order;
3976 let mut raw_file = QcowRawFile::from(disk_file, cluster_size, refcount_bits)
3977 .expect("Failed to create QcowRawFile.");
3978 QcowFile::rebuild_refcounts(&mut raw_file, header)
3979 .expect("Failed to rebuild recounts.");
3980 });
3981 }
3982
3983 // Helper to create a v3 header with specific incompatible feature bits set
3984 fn header_v3_with_incompat_features(features: u64) -> Vec<u8> {

Callers 1

parse_qcowFunction · 0.85

Calls 3

with_basic_fileFunction · 0.85
valid_header_v3Function · 0.85
newFunction · 0.85

Tested by

no test coverage detected