Skip to content

Commit c4d60e4

Browse files
committed
feat(tdx): select KvmVmType::TDX when TDX is enabled
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
1 parent f6f22bc commit c4d60e4

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

alioth/src/hv/kvm/vm/vm_x86_64.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,13 @@ impl VmArch {
6868

6969
impl KvmVm {
7070
pub fn determine_vm_type(config: &VmConfig) -> KvmVmType {
71-
match &config.coco {
72-
Some(Coco::AmdSnp { .. }) => KvmVmType::SNP,
73-
_ => KvmVmType::DEFAULT,
71+
let Some(coco) = &config.coco else {
72+
return KvmVmType::DEFAULT;
73+
};
74+
match coco {
75+
Coco::AmdSev { .. } => KvmVmType::DEFAULT,
76+
Coco::AmdSnp { .. } => KvmVmType::SNP,
77+
Coco::IntelTdx { .. } => KvmVmType::TDX,
7478
}
7579
}
7680

0 commit comments

Comments
 (0)