diff --git a/src/runtime/virtcontainers/qemu_arch_base.go b/src/runtime/virtcontainers/qemu_arch_base.go index 88e23a8ade..4cafe02b3a 100644 --- a/src/runtime/virtcontainers/qemu_arch_base.go +++ b/src/runtime/virtcontainers/qemu_arch_base.go @@ -177,6 +177,30 @@ const ( seProtection //nolint ) +var guestProtectionStr = [...]string{ + noneProtection: "none", + tdxProtection: "tdx", + sevProtection: "sev", + pefProtection: "pef", + seProtection: "se", +} + +func (gp guestProtection) String() string { + return guestProtectionStr[gp] +} + +func genericAvailableGuestProtections() (protections []string) { + return +} + +func AvailableGuestProtections() (protections []string) { + gp, err := availableGuestProtection() + if err != nil || gp == noneProtection { + return genericAvailableGuestProtections() + } + return []string{gp.String()} +} + type qemuArchBase struct { qemuExePath string qemuMachine govmmQemu.Machine