diff --git a/test_infra/src/lib.rs b/test_infra/src/lib.rs index d6e21cd5c..6a7225577 100644 --- a/test_infra/src/lib.rs +++ b/test_infra/src/lib.rs @@ -7,7 +7,7 @@ use std::collections::HashMap; use std::ffi::OsStr; -use std::fmt::Display; +use std::fmt::{Display, Formatter}; use std::fs::OpenOptions; use std::io::{Read, Seek, SeekFrom, Write}; use std::net::{TcpListener, TcpStream}; @@ -2505,6 +2505,15 @@ impl FromStr for GuestVmType { } } +impl Display for GuestVmType { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + match self { + GuestVmType::Regular => write!(f, "regular"), + GuestVmType::Confidential => write!(f, "confidential"), + } + } +} + // Get the direct igvm boot file path based on the console type fn direct_igvm_boot_path(console: Option<&str>) -> Option { // get the default hvc0 igvm file if console string is not passed