From 56a986145eabaa6640fe6709ba89d1f6ec736960 Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Wed, 1 Apr 2026 18:35:27 -0700 Subject: [PATCH] performance-metrics: Add vm_type to PerformanceTestOverrides Add an optional vm_type field to PerformanceTestOverrides to allow overriding the VM type at runtime. Include vm_type in the Display output for override logging. Signed-off-by: Muminul Islam --- performance-metrics/src/main.rs | 4 ++++ test_infra/src/lib.rs | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/performance-metrics/src/main.rs b/performance-metrics/src/main.rs index 76e9d4b53..b099860ce 100644 --- a/performance-metrics/src/main.rs +++ b/performance-metrics/src/main.rs @@ -178,6 +178,7 @@ pub struct PerformanceTestOverrides { test_iterations: Option, test_timeout: Option, test_image_format: Option, + vm_type: GuestVmType, } impl fmt::Display for PerformanceTestOverrides { @@ -193,6 +194,8 @@ impl fmt::Display for PerformanceTestOverrides { write!(f, "test_image_format = {test_image_format}")?; } + write!(f, "vm_type = {}", self.vm_type)?; + Ok(()) } } @@ -1887,6 +1890,7 @@ fn main() { .map(|s| s.parse()) .transpose() .unwrap_or_default(), + vm_type: GuestVmType::Regular, }); // Skip heavy VM level init/cleanup when only micro benchmarks are selected. diff --git a/test_infra/src/lib.rs b/test_infra/src/lib.rs index 6a7225577..9f825da9f 100644 --- a/test_infra/src/lib.rs +++ b/test_infra/src/lib.rs @@ -2487,8 +2487,9 @@ pub fn extract_bar_address(output: &str, device_desc: &str, bar_index: usize) -> None } -#[derive(PartialEq, Clone, Copy)] +#[derive(PartialEq, Clone, Copy, Default)] pub enum GuestVmType { + #[default] Regular, Confidential, }