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,
)
| 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( |
nothing calls this directly
no test coverage detected