From nobody Wed May 14 03:34:40 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1528813438537625.4350292153338; Tue, 12 Jun 2018 07:23:58 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1827E5D675; Tue, 12 Jun 2018 14:23:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0F459588C; Tue, 12 Jun 2018 14:23:56 +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 6A1761800531; Tue, 12 Jun 2018 14:23:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5CENquS020305 for ; Tue, 12 Jun 2018 10:23:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 75F1E111C4A9; Tue, 12 Jun 2018 14:23:52 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id EFB0C111C4A2; Tue, 12 Jun 2018 14:23:51 +0000 (UTC) From: Erik Skultety To: libvir-list@redhat.com Date: Tue, 12 Jun 2018 16:23:38 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [libvirt-python PATCH 2/2] Add support for virNodeGetSEVInfo 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 12 Jun 2018 14:23:57 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This binding allows to query the AMD's SEV firmware for various platform specific things, like a PDH certificate and a certificate chain to establish a trusted connection with the firmware. Because the API uses typed params, it's exempted from generation. Signed-off-by: Erik Skultety --- generator.py | 1 + libvirt-override-api.xml | 6 ++++++ libvirt-override.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) diff --git a/generator.py b/generator.py index 643d1b4..353adab 100755 --- a/generator.py +++ b/generator.py @@ -490,6 +490,7 @@ skip_impl =3D ( 'virDomainGetGuestVcpus', 'virConnectBaselineHypervisorCPU', 'virDomainGetLaunchSecurityInfo', + 'virNodeGetSEVInfo', ) lxc_skip_impl =3D ( diff --git a/libvirt-override-api.xml b/libvirt-override-api.xml index 7137237..7f7ae58 100644 --- a/libvirt-override-api.xml +++ b/libvirt-override-api.xml @@ -734,5 +734,11 @@ + + Get platform specific information from the SEV firmware + + + + diff --git a/libvirt-override.c b/libvirt-override.c index 5de8693..a0584a7 100644 --- a/libvirt-override.c +++ b/libvirt-override.c @@ -9796,6 +9796,40 @@ libvirt_virDomainGetLaunchSecurityInfo(PyObject *sel= f ATTRIBUTE_UNUSED, virTypedParamsFree(params, nparams); return ret; } + + +static PyObject * +libvirt_virNodeGetSEVInfo(PyObject *self ATTRIBUTE_UNUSED, + PyObject *args) +{ + PyObject *pyobj_conn =3D NULL; + PyObject *ret =3D NULL; + + virConnectPtr conn =3D NULL; + virTypedParameterPtr params =3D NULL; + int nparams =3D 0; + unsigned int flags =3D 0; + int i_retval; + + if (!PyArg_ParseTuple(args, (char *)"OI:virNodeGetSEVInfo", + &pyobj_conn, &flags)) + return NULL; + conn =3D (virConnectPtr) PyvirConnect_Get(pyobj_conn); + + LIBVIRT_BEGIN_ALLOW_THREADS; + i_retval =3D virNodeGetSEVInfo(conn, params, nparams, flags); + LIBVIRT_END_ALLOW_THREADS; + + if (i_retval < 0) { + ret =3D VIR_PY_NONE; + goto cleanup; + } + + ret =3D getPyVirTypedParameter(params, nparams); + cleanup: + virTypedParamsFree(params, nparams); + return ret; +} #endif /* LIBVIR_CHECK_VERSION(4, 5, 0) */ -- 2.14.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list