From nobody Sun Feb 8 19:39:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1638989248; cv=none; d=zohomail.com; s=zohoarc; b=Vcnglg3kqlBSKbVMXL+v3c9QcgwcGn/vaC0fpgxlDHYD8Qmye91gFDiZuAZfcFhGWkhYb5FGRGLMH1t50d4o+oJuzc+TBTj/tQoEItQp3+qoKciTgEM0Qi1d/nXwsK67IgNwbF/lGzGGgczgsnSzk/4VxLXlAUzgvQIJJyIEZT4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638989248; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ETulMiTWuzzkToZiXkGSFC8Jiuw/+wXTp63h/ao6HiI=; b=imQgNhnmizc0JIRJoC6hKZTUpMElaFez7oqNE6QO0XOc39mH4vLJnjFdKu7U373WEbaQ/Z1NM1eLH/HbIG8KjtwnwKq6Fua7CjS4TtowU3cwDfaiiy2vaPCykoX8Z0OmUq3AR57yw3lMbobhD+YIqmp1MXpR63xWKAfzR/za6jE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1638989248221640.4149131748891; Wed, 8 Dec 2021 10:47:28 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-258-jw0ydPHBMkmOknOiAMaTkg-1; Wed, 08 Dec 2021 13:47:23 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2F2B61054F91; Wed, 8 Dec 2021 18:47:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 13013100E113; Wed, 8 Dec 2021 18:47:19 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CB4A14A7CA; Wed, 8 Dec 2021 18:47:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1B8IjNLj017614 for ; Wed, 8 Dec 2021 13:45:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0035817CD9; Wed, 8 Dec 2021 18:45:23 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.39.194.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F7EE5E24E; Wed, 8 Dec 2021 18:45:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638989247; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ETulMiTWuzzkToZiXkGSFC8Jiuw/+wXTp63h/ao6HiI=; b=XJ7+sYa9+bk4p4eQUj3f6aN4f3tEQuknmOCiv8evURISRmGSYwQKpvzsfDX0/S7U4dyMGv uyfMQJ6W+45N/ZCmP5/XLprHcs750xYk24vV+McAxI8Mi6qQLOfX/gjsfdJlKUKWv+X7jl tYhVApoX1nLDxf+2cWQSQNAAqgZOcik= X-MC-Unique: jw0ydPHBMkmOknOiAMaTkg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 6/6] tools: add 'nodesevinfo' virsh command Date: Wed, 8 Dec 2021 18:44:34 +0000 Message-Id: <20211208184434.2819757-7-berrange@redhat.com> In-Reply-To: <20211208184434.2819757-1-berrange@redhat.com> References: <20211208184434.2819757-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1638989248608100001 While some SEV info is reported in the domain capabilities, for reasons of size, this excludes the certificates. The nodesevinfo command provides the full set of information. Signed-off-by: Daniel P. Berrang=C3=A9 --- tools/virsh-host.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/tools/virsh-host.c b/tools/virsh-host.c index 5da1346a9c..5ee3834de2 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -888,6 +888,45 @@ cmdNodeMemStats(vshControl *ctl, const vshCmd *cmd) return true; } =20 +/* + * "nodesevinfo" command + */ +static const vshCmdInfo info_nodesevinfo[] =3D { + {.name =3D "help", + .data =3D N_("node SEV information") + }, + {.name =3D "desc", + .data =3D N_("Returns basic SEV information about the node.") + }, + {.name =3D NULL} +}; + +static bool +cmdNodeSEVInfo(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) +{ + virshControl *priv =3D ctl->privData; + size_t i; + int nparams =3D 0; + virTypedParameterPtr params =3D NULL; + bool ret =3D false; + + if (virNodeGetSEVInfo(priv->conn, ¶ms, &nparams, 0) !=3D 0) { + vshError(ctl, "%s", _("Unable to get host SEV information")); + goto cleanup; + } + + for (i =3D 0; i < nparams; i++) { + g_autofree char *str =3D vshGetTypedParamValue(ctl, ¶ms[i]); + vshPrint(ctl, "%-18s: %s\n", params[i].field, str); + } + + ret =3D true; + + cleanup: + virTypedParamsFree(params, nparams); + return ret; +} + /* * "nodesuspend" command */ @@ -1828,6 +1867,12 @@ const vshCmdDef hostAndHypervisorCmds[] =3D { .info =3D info_nodememstats, .flags =3D 0 }, + {.name =3D "nodesevinfo", + .handler =3D cmdNodeSEVInfo, + .opts =3D NULL, + .info =3D info_nodesevinfo, + .flags =3D 0 + }, {.name =3D "nodesuspend", .handler =3D cmdNodeSuspend, .opts =3D opts_node_suspend, --=20 2.33.1