]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tools: be explicit about failure to find x86 secure virt
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 20 Nov 2025 09:42:35 +0000 (04:42 -0500)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 20 Nov 2025 17:26:18 +0000 (17:26 +0000)
If we fail to find either SEV or TDX on x86, we can explicitly
say there is no secure guest support on the platform.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
tools/virt-host-validate-common.c

index 344f9656e5cf1170dbc4606712f2a903be7ad82b..6bca661ffc477ba0130c6db3b4788644bc2b64a0 100644 (file)
@@ -492,13 +492,17 @@ int virHostValidateSecureGuests(const char *hvname,
                             "support for IBM Secure Execution");
             return VIR_VALIDATE_FAILURE(level);
         }
-    } else if (hasAMDSev) {
-        return virHostValidateAMDSev(hvname, level);
-    } else if (hasIntelTDX) {
-        return virHostValidateIntelTDX(level);
+    } else if (arch == VIR_ARCH_X86_64) {
+        if (hasAMDSev) {
+            return virHostValidateAMDSev(level);
+        } else if (hasIntelTDX) {
+            return virHostValidateIntelTDX(level);
+        } else {
+            virValidateFail(level, "None of SEV, SEV-ES, SEV-SNP, TDX available");
+        }
+    } else {
+        virValidateFail(level,
+                        "Unknown if this platform has Secure Guest support");
     }
-
-    virValidateFail(level,
-                    "Unknown if this platform has Secure Guest support");
     return VIR_VALIDATE_FAILURE(level);
 }