From b10256a7cae979c755d88d887b4b4b6d686e2ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Wed, 4 Sep 2024 11:54:52 +0200 Subject: [PATCH] runtime: Don't error out about SNP cert path on non SNP platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This error is specific to SNP platforms, so let's make sure we only error this out when an SNP platform is used. Signed-off-by: Fabiano FidĂȘncio --- src/runtime/pkg/katautils/config.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/runtime/pkg/katautils/config.go b/src/runtime/pkg/katautils/config.go index 9d1f2eacb3..80adc61ae8 100644 --- a/src/runtime/pkg/katautils/config.go +++ b/src/runtime/pkg/katautils/config.go @@ -299,6 +299,16 @@ func (h hypervisor) firmware() (string, error) { } func (h hypervisor) snpCertsPath() (string, error) { + // snpCertsPath only matter when using Confidential Guests + if !h.ConfidentialGuest { + return "", nil + } + + // snpCertsPath only matter for SNP guests + if !h.SevSnpGuest { + return "", nil + } + p := h.SnpCertsPath if p == "" {