performance-metrics: Add sparse async QCOW2 tempfile helper

Add sparse_qcow_async_tempfile which creates a sparse QCOW2 image
with one cluster per L2 table and opens it via QcowDiskAsync.
Mirrors the existing sparse_qcow_tempfile for io_uring benchmarks.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-03-27 13:06:01 +01:00
committed by Rob Bradford
parent 1d5d13eb7b
commit 3804968eef

View File

@@ -308,6 +308,14 @@ pub fn sparse_qcow_tempfile(num_l2_tables: usize) -> (TempFile, QcowDiskSync) {
(tmp, disk)
}
/// Sparse QCOW2 opened via QcowDiskAsync.
pub fn sparse_qcow_async_tempfile(num_l2_tables: usize) -> (TempFile, QcowDiskAsync) {
let tmp = create_sparse_qcow_tempfile(num_l2_tables);
let disk = QcowDiskAsync::new(tmp.as_file().try_clone().unwrap(), false, false, true)
.expect("failed to open qcow2 via QcowDiskAsync");
(tmp, disk)
}
/// Spin and wait until the given eventfd becomes readable.
pub fn wait_for_eventfd(notifier: &EventFd) {
loop {