mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
performance-metrics: Add empty async QCOW2 tempfile helper
Add empty_qcow_async_tempfile which creates an empty QCOW2 image and opens it via QcowDiskAsync. Mirrors the existing empty_qcow_tempfile for io_uring write benchmarks. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
fca6429e9b
commit
1069505151
@@ -158,6 +158,14 @@ pub fn empty_qcow_tempfile(num_clusters: usize) -> (TempFile, QcowDiskSync) {
|
||||
(tmp, disk)
|
||||
}
|
||||
|
||||
/// Empty QCOW2 opened via QcowDiskAsync.
|
||||
pub fn empty_qcow_async_tempfile(num_clusters: usize) -> (TempFile, QcowDiskAsync) {
|
||||
let tmp = create_empty_qcow_tempfile(num_clusters);
|
||||
let disk = QcowDiskAsync::new(tmp.as_file().try_clone().unwrap(), false, false, true)
|
||||
.expect("failed to open qcow2 via QcowDiskAsync");
|
||||
(tmp, disk)
|
||||
}
|
||||
|
||||
/// Create a QCOW2 overlay backed by a raw file with `num_clusters`
|
||||
/// pre-populated clusters. Returns (backing_tempfile, overlay_tempfile).
|
||||
fn create_overlay_tempfiles(num_clusters: usize) -> (TempFile, TempFile) {
|
||||
|
||||
Reference in New Issue
Block a user