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

Function qcow_tempfile

performance-metrics/src/util.rs:55–66  ·  view source on GitHub ↗

Create a QCOW2 image with `num_clusters` allocated clusters opened via QcowDisk with synchronous backend.

(num_clusters: usize)

Source from the content-addressed store, hash-verified

53/// Create a QCOW2 image with `num_clusters` allocated clusters opened
54/// via QcowDisk with synchronous backend.
55pub fn qcow_tempfile(num_clusters: usize) -> (TempFile, QcowDisk) {
56 let tmp = create_qcow_tempfile(num_clusters);
57 let disk = QcowDisk::new(
58 tmp.as_file().try_clone().unwrap(),
59 false,
60 false,
61 true,
62 false,
63 )
64 .expect("failed to open QCOW2 via QcowDisk");
65 (tmp, disk)
66}
67
68/// Create a QCOW2 image with `num_clusters` allocated clusters opened
69/// via QcowDisk with io_uring backend.

Calls 3

create_qcow_tempfileFunction · 0.85
newFunction · 0.85
try_cloneMethod · 0.45

Tested by

no test coverage detected