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

Method from_with_nesting_depth

block/src/qcow/mod.rs:689–718  ·  view source on GitHub ↗

Creates a QcowFile from `file` and with a max nesting depth. File must be a valid qcow2 image.

(
        file: RawFile,
        max_nesting_depth: u32,
        sparse: bool,
    )

Source from the content-addressed store, hash-verified

687 /// Creates a QcowFile from `file` and with a max nesting depth. File must be a valid qcow2
688 /// image.
689 pub fn from_with_nesting_depth(
690 file: RawFile,
691 max_nesting_depth: u32,
692 sparse: bool,
693 ) -> BlockResult<QcowFile> {
694 let (inner, backing_file, sparse) = parse_qcow(file, max_nesting_depth, sparse)?;
695 let metadata::QcowState {
696 raw_file,
697 header,
698 l1_table,
699 l2_entries,
700 l2_cache,
701 refcounts,
702 avail_clusters,
703 unref_clusters,
704 } = inner;
705 Ok(QcowFile {
706 raw_file,
707 header,
708 l1_table,
709 l2_entries,
710 l2_cache,
711 refcounts,
712 current_offset: 0,
713 unref_clusters,
714 avail_clusters,
715 backing_file,
716 sparse,
717 })
718 }
719
720 /// Creates a new QcowFile at the given path.
721 pub fn new(

Callers

nothing calls this directly

Calls 1

parse_qcowFunction · 0.85

Tested by

no test coverage detected