mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
committed by
Rob Bradford
parent
1d5d13eb7b
commit
3804968eef
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user