From nobody Fri Nov 21 10:00:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1763633917; cv=none; d=zohomail.com; s=zohoarc; b=XfQpaVHgJFG+n+rAtU4axh+MrtnkB97lF6mVTk/lODrgReZVWh2JHJcw5SopxLtd8T/NtOPbyIUA1DZHk83Kh/YLmP8FCgSGYPQMsGp2rZf4RSgKuAZ9+ZSoKE+3cW09LjG82rraWhwKPReKzLBFzktrfn0UL9fhEyfGr3R5Suk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763633917; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=dwILjdRp03NkZTxPNtAcXsT/Lt76T+Mh4J8H5uHgvg8=; b=moECqpbqnalHZguwZ9Kyt///UmR3vaT9s8yJYky0FMgCdPNjJRLlfX872QleFCom5gOEia+cWctQeEXhnjHwdPYVZ/5l8Ew4IyyZuVcNb7OhSL4qAa5i4iN9fZssT4GKNU49AMcMlYvqQdaAgcqclhI2vQa0KlRCE3KtynOMkOc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1763633917856841.3746669757791; Thu, 20 Nov 2025 02:18:37 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 4AD87441C2; Thu, 20 Nov 2025 05:18:37 -0500 (EST) Received: from [172.19.199.53] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 3B8B2442BE; Thu, 20 Nov 2025 05:17:08 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 858C041B2F; Thu, 20 Nov 2025 05:15:00 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 744CC41B50 for ; Thu, 20 Nov 2025 05:14:59 -0500 (EST) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-397-dDNhCoDEMkCWZs2px5MXEQ-1; Thu, 20 Nov 2025 05:14:57 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7624719540D5 for ; Thu, 20 Nov 2025 10:14:56 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.114]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4D0FB180094D; Thu, 20 Nov 2025 10:14:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763633699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dwILjdRp03NkZTxPNtAcXsT/Lt76T+Mh4J8H5uHgvg8=; b=LYtUHL7CnEr/4E0wwOucT/CBqri/6f6LUIpw59pdcF8OuywKqsTi7uC09EKAocsBmgJegv Di4F2VrG5jmG6++8OieV8bBomMhfGT73LWr25Ol6i5Kmde91k9c4pymMQPvT5WrTs+GsbS olm6wayBdWvF7uyVZ2VySGfZgzj1UbA= X-MC-Unique: dDNhCoDEMkCWZs2px5MXEQ-1 X-Mimecast-MFC-AGG-ID: dDNhCoDEMkCWZs2px5MXEQ_1763633696 To: devel@lists.libvirt.org Subject: [PATCH 1/5] tools: allow passing details for passed validation tests Date: Thu, 20 Nov 2025 10:14:47 +0000 Message-ID: <20251120101451.3468378-2-berrange@redhat.com> In-Reply-To: <20251120101451.3468378-1-berrange@redhat.com> References: <20251120101451.3468378-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 88AwbWV3PL_gD2kFW9lizbioEm481yuw3IWVmq27Y1k_1763633696 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: INNDSMTRFZNRAFAVAZ6I26J5QJLNTD76 X-Message-ID-Hash: INNDSMTRFZNRAFAVAZ6I26J5QJLNTD76 X-MailFrom: berrange@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9_via_Devel?= Reply-To: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1763633919936018900 From: Daniel P. Berrang=C3=A9 In a number of virt-host-validte tests we are testing for at least one out of multiple acceptable features. For example the 'secure guest' test can be satisfied by s390x protvirt, or x86 TDX, SEV, SEV-ES, SEV-SNP. It would be useful to inform the user which one we detected when the test passes. This introduces virValidatePassDetails to enable that. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- tools/virt-validate-common.c | 12 +++++++++++- tools/virt-validate-common.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/virt-validate-common.c b/tools/virt-validate-common.c index 9768fd9208..ef6130ff2a 100644 --- a/tools/virt-validate-common.c +++ b/tools/virt-validate-common.c @@ -62,14 +62,24 @@ static bool virValidateWantEscape(void) } =20 void virValidatePass(void) +{ + virValidatePassDetails(NULL); +} + +void virValidatePassDetails(const char *info) { if (quiet) return; =20 if (virValidateWantEscape()) - fprintf(stdout, "\033[32m%s\033[0m\n", _("PASS")); + fprintf(stdout, "\033[32m%s\033[0m", _("PASS")); else fprintf(stdout, "%s\n", _("PASS")); + + if (info) + fprintf(stdout, " (%s)\n", info); + else + fprintf(stdout, "\n"); } =20 =20 diff --git a/tools/virt-validate-common.h b/tools/virt-validate-common.h index 7f7c373a66..8981f5af71 100644 --- a/tools/virt-validate-common.h +++ b/tools/virt-validate-common.h @@ -52,6 +52,7 @@ void virValidateCheck(const char *prefix, ...) G_GNUC_PRINTF(2, 3); =20 void virValidatePass(void); +void virValidatePassDetails(const char *info); void virValidateFail(virValidateLevel level, const char *format, ...) G_GNUC_PRINTF(2, 3); --=20 2.51.1 From nobody Fri Nov 21 10:00:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1763633975; cv=none; d=zohomail.com; s=zohoarc; b=TysbPvtzEgf6oracMkN1WNF5E/9ptDJIH/dEvfXN6508I0mebQmzaPfrYtPXq2dLH/FRxt/vl/dImi5UEwYkjGY6kLWl6yEKYomTMd6qr9rvPeBYagWwT2EpjN5x9QHUJCkgiQKd4NJCOjAu8VlZOtDoxGoal2Sj5oyizU4Th0k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763633975; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=g4QltSd4AoxBU5eFe+/4WpIN3gc1kJGJTT6sp/UNy4c=; b=h5HOa/US6+84hhVWIqVvVAZ9H2uVyj1R1mFecM0ryu96ha1KXfWlvtDNgXEk1TQ2nOYItM3sHingeoovjk62ixd3Ez4TOqcyfO9Tw2n5+twa887A6ejyn2cuClgmVhZWATAhHhBkOASvYs50gk0ZwIn4PL5TxPOr53rRnKIbTOE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1763633975343446.0285376618093; Thu, 20 Nov 2025 02:19:35 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id AD9CD43F4E; Thu, 20 Nov 2025 05:19:34 -0500 (EST) Received: from [172.19.199.53] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id DA68144201; Thu, 20 Nov 2025 05:17:13 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 3D27C41B50; Thu, 20 Nov 2025 05:15:02 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 71ABF41B50 for ; Thu, 20 Nov 2025 05:15:01 -0500 (EST) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-509-nbKi8iYBOo6r7AF8GIiQVQ-1; Thu, 20 Nov 2025 05:14:59 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 64C3018002F4 for ; Thu, 20 Nov 2025 10:14:58 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.114]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 40E37180087B; Thu, 20 Nov 2025 10:14:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763633701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g4QltSd4AoxBU5eFe+/4WpIN3gc1kJGJTT6sp/UNy4c=; b=EhvOUxCPC1FrGy43pxcd/8hGXgvWaec6gzzVXgD1+XWF+xHYSTTbtFDTKp7BbJbTI9y7t0 va6j7Ql/tMz3u2FPu09qWW7FOZu9otKA8ErkVXxpxj2CZgkrYSvfH0vZCjm0mspbS9d7m2 +/d3DViEFSXdd1OG7mhrlDWfcpvsEZA= X-MC-Unique: nbKi8iYBOo6r7AF8GIiQVQ-1 X-Mimecast-MFC-AGG-ID: nbKi8iYBOo6r7AF8GIiQVQ_1763633698 To: devel@lists.libvirt.org Subject: [PATCH 2/5] tools: inform user which IOMMU was found during validation Date: Thu, 20 Nov 2025 10:14:48 +0000 Message-ID: <20251120101451.3468378-3-berrange@redhat.com> In-Reply-To: <20251120101451.3468378-1-berrange@redhat.com> References: <20251120101451.3468378-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: yH9iZ-Be56j2yEmOkJDeCx7Fxfx90nlE0cCqdUxJy4I_1763633698 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: O6MUT4S4TKGUTEJ5HKOWUGWGEZCW74CT X-Message-ID-Hash: O6MUT4S4TKGUTEJ5HKOWUGWGEZCW74CT X-MailFrom: berrange@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9_via_Devel?= Reply-To: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1763633978363018900 From: Daniel P. Berrang=C3=A9 Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- tools/virt-host-validate-common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-c= ommon.c index 59f6ac3319..6516d96484 100644 --- a/tools/virt-host-validate-common.c +++ b/tools/virt-host-validate-common.c @@ -260,7 +260,7 @@ int virHostValidateIOMMU(const char *hvname, =20 if (isIntel) { if (access("/sys/firmware/acpi/tables/DMAR", F_OK) =3D=3D 0) { - virValidatePass(); + virValidatePassDetails("DMAR"); bootarg =3D "intel_iommu=3Don"; } else { virValidateFail(level, @@ -271,7 +271,7 @@ int virHostValidateIOMMU(const char *hvname, } } else if (isAMD) { if (access("/sys/firmware/acpi/tables/IVRS", F_OK) =3D=3D 0) { - virValidatePass(); + virValidatePassDetails("IVRS"); bootarg =3D "iommu=3Dpt iommu=3D1"; } else { virValidateFail(level, @@ -318,7 +318,7 @@ int virHostValidateIOMMU(const char *hvname, "No SMMU found"); return VIR_VALIDATE_FAILURE(level); } else { - virValidatePass(); + virValidatePassDetails("SMMU"); } } } else { --=20 2.51.1 From nobody Fri Nov 21 10:00:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1763634032; cv=none; d=zohomail.com; s=zohoarc; b=X8rpqHKO+h9sPWuN75M3spY42JuDI1DizxKI+4vee+heM4O0gCOE8sjFBqdcoFtDrb+vOTH4l19bRRP30iDDU7FhMbElno/dyAgXeriZAPQ4fDTuyFXRAlixGnq5oalBxiDxdjwKna6HudNOlkU7g4ao48C3IkhuXYUljNMbk8Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763634032; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=4Q0iSHvrNGbav9HIjkH6oY1IZD43ZI1JGeQYAxsyhRc=; b=lNI+e1LtEfAy03wX/8OyMbwEQo0LULJy6rNRy7Nqqy+KhemyCIPxBGT2jHOIl0Og+lXGSJchGhvvRZ6dKPhv8xw0Kh73W5rDrSR5EyIA4DQGKOD8F7BXYDZWMOxStRdv2EArPVcIIbMWtgY7L0xENNh0USdRF3Vhg+Y/7xY9wl0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1763634030976960.099241361827; Thu, 20 Nov 2025 02:20:30 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 8C79744194; Thu, 20 Nov 2025 05:20:27 -0500 (EST) Received: from [172.19.199.53] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 0E0BC44223; Thu, 20 Nov 2025 05:17:18 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 6A85C41B2F; Thu, 20 Nov 2025 05:15:04 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 95C9544105 for ; Thu, 20 Nov 2025 05:15:03 -0500 (EST) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-333-b1w24iroNG2ueTeJRgOerg-1; Thu, 20 Nov 2025 05:15:01 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9665F1954B0D for ; Thu, 20 Nov 2025 10:15:00 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.114]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 04F141800980; Thu, 20 Nov 2025 10:14:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763633703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4Q0iSHvrNGbav9HIjkH6oY1IZD43ZI1JGeQYAxsyhRc=; b=XllNwubkBQKEnQxru0mUxCaevmIgHJO8vxU515pfCsNu4+N+9/hrOJuh75Uek8p367ZWz7 L6JCN66giBC9ODFeNmL8Z4wiJzgG94ORPTa7xEwC/Rsru84ndedgQsJXv3sZpS4BHa65Br 6uWXgVnuu7hh/xYUbtBAg05iHDahed4= X-MC-Unique: b1w24iroNG2ueTeJRgOerg-1 X-Mimecast-MFC-AGG-ID: b1w24iroNG2ueTeJRgOerg_1763633700 To: devel@lists.libvirt.org Subject: [PATCH 3/5] tools: inform user which CVM is found during validation Date: Thu, 20 Nov 2025 10:14:49 +0000 Message-ID: <20251120101451.3468378-4-berrange@redhat.com> In-Reply-To: <20251120101451.3468378-1-berrange@redhat.com> References: <20251120101451.3468378-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: WIPIHArCB7WnAe_rkZuJvM9rAMzWmGFw38wx2WFuFEg_1763633700 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 3N4DQQDHZT6MDK64ULW44DI5P54ROKUV X-Message-ID-Hash: 3N4DQQDHZT6MDK64ULW44DI5P54ROKUV X-MailFrom: berrange@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9_via_Devel?= Reply-To: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1763634034507018900 From: Daniel P. Berrang=C3=A9 For AMD, the virt-host-validate 'secure guest' check reports support for SEV, and there are then further check results printed for SEV-ES/SEV-SNP which are overly verbose and the long lines break output alignment. This uses the new ability to report details with PASS results to concisely tell the user which out of SEV/SEV-ES/SEV-SNP are found. Only a single answer is neede, as SEV-SNP implies SEV & SEV-ES, and SEV-ES implies SEV. The TDX s390x PROT-VIRT checks also identify themselves. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- tools/virt-host-validate-common.c | 36 ++++++++----------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-c= ommon.c index 6516d96484..344f9656e5 100644 --- a/tools/virt-host-validate-common.c +++ b/tools/virt-host-validate-common.c @@ -378,8 +378,7 @@ bool virHostKernelModuleIsLoaded(const char *module) =20 =20 static int -virHostValidateAMDSev(const char *hvname, - virValidateLevel level) +virHostValidateAMDSev(virValidateLevel level) { g_autofree char *mod_value =3D NULL; uint32_t eax, ebx; @@ -405,31 +404,14 @@ virHostValidateAMDSev(const char *hvname, return VIR_VALIDATE_FAILURE(level); } =20 - virValidatePass(); - - virValidateCheck(hvname, "%s", - _("Checking for AMD Secure Encrypted Virtualization-E= ncrypted State (SEV-ES)")); - virHostCPUX86GetCPUID(0x8000001F, 0, &eax, &ebx, NULL, NULL); =20 - if (eax & (1U << 3)) { - virValidatePass(); - } else { - virValidateFail(level, - "AMD SEV-ES is not supported"); - return VIR_VALIDATE_FAILURE(level); - } - - virValidateCheck(hvname, "%s", - _("Checking for AMD Secure Encrypted Virtualization-S= ecure Nested Paging (SEV-SNP)")); - - if (eax & (1U << 4)) { - virValidatePass(); - } else { - virValidateFail(level, - "AMD SEV-SNP is not supported"); - return VIR_VALIDATE_FAILURE(level); - } + if (eax & (1U << 4)) + virValidatePassDetails("SEV-SNP"); + else if (eax & (1U << 3)) + virValidatePassDetails("SEV-ES"); + else + virValidatePassDetails("SEV"); =20 return 1; } @@ -453,7 +435,7 @@ static int virHostValidateIntelTDX(virValidateLevel lev= el) return VIR_VALIDATE_FAILURE(level); } =20 - virValidatePass(); + virValidatePassDetails("TDX"); return 1; } =20 @@ -496,7 +478,7 @@ int virHostValidateSecureGuests(const char *hvname, G_N_ELEMENTS(kIBMValues), VIR_KERNEL_CMDLINE_FLAGS_SEARCH= _FIRST | VIR_KERNEL_CMDLINE_FLAGS_CMP_PR= EFIX)) { - virValidatePass(); + virValidatePassDetails("PROT-VIRT"); return 1; } else { virValidateFail(level, --=20 2.51.1 From nobody Fri Nov 21 10:00:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1763634103; cv=none; d=zohomail.com; s=zohoarc; b=UXpNhveFsFFD+GGvpThzVIgeUU9ehKa2eGn3JR+OhkjbfDQjS16sZfkn5BeCLLltSicOEOUT/Ss6E7IWn3zlFulR4P5onyGx5aj5fmXkwhN+N4ka8IR7h9Z2OA9wobC198z3C+zJ5obhVyTedoIxEjIxdtP3Fh8AyH8c95EP/ng= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763634103; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=52+AEg0olBWJ7LWlEg6dn4Rx2GrOAo2Asm4/X2aA4VQ=; b=Mq1TTf1wIr4WOhcEsmhDWIFoQl/b8Tydlb1RdMuQvPQbcWBY/y3zoHWxSYq8TRthyXC3imu4o526QeQWufs6BvY+aIwtpX9KFzcERaVeucQBXFeDUqt+bjNp/4xRry3QaEUG8eGYGJKDpc/eCyWZCDaarXYjR4K7Sc3qLlgQ4ww= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1763634103948243.84949342689606; Thu, 20 Nov 2025 02:21:43 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 62E1A3F33C; Thu, 20 Nov 2025 05:21:43 -0500 (EST) Received: from [172.19.199.53] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id D3E324418B; Thu, 20 Nov 2025 05:17:22 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id C0BCC43F4A; Thu, 20 Nov 2025 05:15:06 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 092E241B50 for ; Thu, 20 Nov 2025 05:15:06 -0500 (EST) Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-481-CxZ-U20JNEyIAuzBmTviTA-1; Thu, 20 Nov 2025 05:15:04 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A093319560B5 for ; Thu, 20 Nov 2025 10:15:03 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.114]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 30355180049F; Thu, 20 Nov 2025 10:15:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763633705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=52+AEg0olBWJ7LWlEg6dn4Rx2GrOAo2Asm4/X2aA4VQ=; b=jT0UGxGDXmsnr0PBbyhNgqBtHH24OPvS/mKMn+rrvve4KjFIN4+dRwXjW7belb9nwI3O9y k/bHKusfPxtQEbQXuOPPz0KeWKsOFjNT32s8GRydx0/w/UjlENnzoDQfbWq9ctrFY6r9qJ TF9l7+ej7qXgg4Ymc8kB4O8jc+uVzqY= X-MC-Unique: CxZ-U20JNEyIAuzBmTviTA-1 X-Mimecast-MFC-AGG-ID: CxZ-U20JNEyIAuzBmTviTA_1763633703 To: devel@lists.libvirt.org Subject: [PATCH 4/5] tools: be explicit about failure to find x86 secure virt Date: Thu, 20 Nov 2025 10:14:50 +0000 Message-ID: <20251120101451.3468378-5-berrange@redhat.com> In-Reply-To: <20251120101451.3468378-1-berrange@redhat.com> References: <20251120101451.3468378-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: c04-58y1UgpTRfVMvpqR2fW99omxVnbWwDc6maCf5qo_1763633703 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 44W2LUUTNLSFJUDBLJ3GJTTGLGKTOUZK X-Message-ID-Hash: 44W2LUUTNLSFJUDBLJ3GJTTGLGKTOUZK X-MailFrom: berrange@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9_via_Devel?= Reply-To: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1763634104857018900 From: Daniel P. Berrang=C3=A9 If we fail to find either SEV or TDX on x86, we can explicitly say there is no secure guest support on the platform. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- tools/virt-host-validate-common.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-c= ommon.c index 344f9656e5..6bca661ffc 100644 --- a/tools/virt-host-validate-common.c +++ b/tools/virt-host-validate-common.c @@ -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 =3D=3D 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 avai= lable"); + } + } 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); } --=20 2.51.1 From nobody Fri Nov 21 10:00:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1763634185; cv=none; d=zohomail.com; s=zohoarc; b=NPopmCOUSINfQ/N0ceAFIi8nztkAYietJ6q8+qNI42obksWbr1tUd/UU7aYlUrud9CYaK7oKuHRPBYfBgbVUGQTpzjRDwykkAH7QCGU/+kBd1QaCAK1xTGCHEyWUX42M8eoX/iU+TRCWKAlEP26m+R0ZgMgXA62jLtI6j8BT6m4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763634185; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=I6AlW+WPYHwAGMYAsdPLPgmfVODLeMaUbka38eJf6uA=; b=MxX7J6dhdS2mUsy/iAMvJBczhFtq/P2U/aMUtpga9Ke0zsZDXStD3+bCXGY5ARzeQqWC8Ku2g2pzflSK/2WmOrrfzqxN6nX2H2UBux8gSjbLPQXo9YzSQPC860CzXPDzfdJHSYksMSps65eb5yOjKV4UnmVd3xZnpU7o4IiFK2A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1763634185415490.1603062480218; Thu, 20 Nov 2025 02:23:05 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id CDBBE417F4; Thu, 20 Nov 2025 05:23:04 -0500 (EST) Received: from [172.19.199.53] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 6976F446EE; Thu, 20 Nov 2025 05:17:27 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id C74AA41BC6; Thu, 20 Nov 2025 05:15:10 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 7950141B50 for ; Thu, 20 Nov 2025 05:15:09 -0500 (EST) Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-354-Bio2lVKNPIuPbkJyGEhqoQ-1; Thu, 20 Nov 2025 05:15:07 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D6097195605B for ; Thu, 20 Nov 2025 10:15:06 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.114]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EAB521800947; Thu, 20 Nov 2025 10:15:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763633709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I6AlW+WPYHwAGMYAsdPLPgmfVODLeMaUbka38eJf6uA=; b=NpKndOPlGpdkJOBm/x4aHENimqiT30J08UwiDvLzlxzO7GD+aRP1QOiY1VlT1W8GFHD+n5 fYaydGit+sPHxvMOHPVFDCftY1D9YLdaggM6U75OGIK3xODeiKjt+3oO/5dR/Lgr8t8KdK muhtletTK518A7TNrvrc9KvvRd1F7+A= X-MC-Unique: Bio2lVKNPIuPbkJyGEhqoQ-1 X-Mimecast-MFC-AGG-ID: Bio2lVKNPIuPbkJyGEhqoQ_1763633707 To: devel@lists.libvirt.org Subject: [PATCH 5/5] tools: inform user which hardware virt was found during validation Date: Thu, 20 Nov 2025 10:14:51 +0000 Message-ID: <20251120101451.3468378-6-berrange@redhat.com> In-Reply-To: <20251120101451.3468378-1-berrange@redhat.com> References: <20251120101451.3468378-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: uF6DxYo8Bg-p_gd_lE1-ZEigZ-Jo2J5t1oqL1LMUOwU_1763633707 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: Q4V25J5KZILPOA5SM4ATZBZGQJ74AVC7 X-Message-ID-Hash: Q4V25J5KZILPOA5SM4ATZBZGQJ74AVC7 X-MailFrom: berrange@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9_via_Devel?= Reply-To: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1763634187167018900 From: Daniel P. Berrang=C3=A9 On x86 we can indicate VMX or SVM, while s390x would be SIE. There are several choices on ppc64 and virt-host-validate does not try to detect any, so don't report a specific technology on ppc64 arch. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- tools/virt-host-validate-qemu.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/virt-host-validate-qemu.c b/tools/virt-host-validate-qem= u.c index 833bb1b914..f04fc61cb3 100644 --- a/tools/virt-host-validate-qemu.c +++ b/tools/virt-host-validate-qemu.c @@ -34,6 +34,7 @@ int virHostValidateQEMU(void) bool hasHwVirt =3D false; bool hasVirtFlag =3D false; virArch arch =3D virArchFromHost(); + const char *hwVirtName =3D NULL; const char *kvmhint =3D _("Check that CPU and firmware supports virtua= lization and kvm module is loaded"); =20 if (!(flags =3D virHostValidateGetCPUFlags())) @@ -44,15 +45,22 @@ int virHostValidateQEMU(void) case VIR_ARCH_X86_64: hasVirtFlag =3D true; kvmhint =3D _("Check that the 'kvm-intel' or 'kvm-amd' modules are= loaded & the BIOS has enabled virtualization"); - if (virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SVM) || - virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_VMX)) + if (virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SVM)) { + hwVirtName =3D "SVM"; hasHwVirt =3D true; + } + if (virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_VMX)) { + hwVirtName =3D "VMX"; + hasHwVirt =3D true; + } break; case VIR_ARCH_S390: case VIR_ARCH_S390X: hasVirtFlag =3D true; - if (virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SIE)) + if (virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SIE)) { + hwVirtName =3D "SIE"; hasHwVirt =3D true; + } break; case VIR_ARCH_PPC64: case VIR_ARCH_PPC64LE: @@ -66,7 +74,7 @@ int virHostValidateQEMU(void) if (hasVirtFlag) { virValidateCheck("QEMU", "%s", _("Checking for hardware virtualiza= tion")); if (hasHwVirt) { - virValidatePass(); + virValidatePassDetails(hwVirtName); } else { virValidateFail(VIR_VALIDATE_FAIL, _("Host not compatible with KVM; HW virtualiza= tion CPU features not found. Only emulated CPUs are available; performance = will be significantly limited")); --=20 2.51.1