mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
performance-metrics: Add async QCOW2 overlay tempfile helper
Add qcow_async_overlay_tempfile which creates a QCOW2 overlay backed by a RAW file and opens it via QcowDiskAsync. Mirrors the existing qcow_overlay_tempfile for io_uring benchmarks. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
2041ba5a91
commit
c8fee5953f
@@ -196,6 +196,14 @@ pub fn qcow_overlay_tempfile(num_clusters: usize) -> (TempFile, TempFile, QcowDi
|
||||
(backing, overlay, disk)
|
||||
}
|
||||
|
||||
/// QCOW2 overlay with raw backing opened via QcowDiskAsync.
|
||||
pub fn qcow_async_overlay_tempfile(num_clusters: usize) -> (TempFile, TempFile, QcowDiskAsync) {
|
||||
let (backing, overlay) = create_overlay_tempfiles(num_clusters);
|
||||
let disk = QcowDiskAsync::new(overlay.as_file().try_clone().unwrap(), false, true, true)
|
||||
.expect("failed to open overlay qcow2 via QcowDiskAsync");
|
||||
(backing, overlay, disk)
|
||||
}
|
||||
|
||||
/// Create a zlib compressed QCOW2 image with `num_clusters` clusters
|
||||
/// via `qemu-img convert -c`.
|
||||
fn create_compressed_qcow_tempfile(num_clusters: usize) -> TempFile {
|
||||
|
||||
Reference in New Issue
Block a user