Create a qcow2 file with itself as its backing file. Without configuration `max_nesting_depth`, this will cause infinite recursion when loading the file until stack overflow.
(path: &Path)
| 2707 | /// Without configuration `max_nesting_depth`, this will cause infinite recursion when loading |
| 2708 | /// the file until stack overflow. |
| 2709 | fn new_self_referential_qcow(path: &Path) -> Result<()> { |
| 2710 | let header = QcowHeader::create_for_size_and_path(3, 0x10_0000, path.to_str())?; |
| 2711 | let mut disk_file = RawFile::new( |
| 2712 | File::create(path).expect("Failed to create image file."), |
| 2713 | false, |
| 2714 | ); |
| 2715 | header.write_to(&mut disk_file)?; |
| 2716 | Ok(()) |
| 2717 | } |
| 2718 | |
| 2719 | #[test] |
| 2720 | fn max_nesting_backing() { |