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

Function qcow_async_tempfile

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

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

(num_clusters: usize)

Source from the content-addressed store, hash-verified

68/// Create a QCOW2 image with `num_clusters` allocated clusters opened
69/// via QcowDisk with io_uring backend.
70pub fn qcow_async_tempfile(num_clusters: usize) -> (TempFile, QcowDisk) {
71 let tmp = create_qcow_tempfile(num_clusters);
72 let disk = QcowDisk::new(tmp.as_file().try_clone().unwrap(), false, false, true, true)
73 .expect("failed to open QCOW2 via QcowDisk");
74 (tmp, disk)
75}
76
77/// Drain `count` completions from a synchronous async_io backend.
78pub fn drain_completions(async_io: &mut dyn AsyncIo, count: usize) {

Calls 3

create_qcow_tempfileFunction · 0.85
newFunction · 0.85
try_cloneMethod · 0.45

Tested by

no test coverage detected