mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
test_infra: Implement Display for GuestVmType
Add Display trait implementation for GuestVmType to enable formatted output of the VM type in logs and diagnostics. Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
0e7fcc623e
commit
11623a2183
@@ -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<PathBuf> {
|
||||
// get the default hvc0 igvm file if console string is not passed
|
||||
|
||||
Reference in New Issue
Block a user