diff options
author | Erik Skultety <eskultet@redhat.com> | 2018-06-12 16:17:58 +0200 |
---|---|---|
committer | Erik Skultety <eskultet@redhat.com> | 2018-06-14 17:23:19 +0200 |
commit | 6c136b8150e1487efdbb10bfd32a5d8a0f84df16 (patch) | |
tree | 2203af29b65f5b16f2201939606147a0d57f196f /libvirt-override.c | |
parent | dbae262811f49ebf9a1c94cea6ffd4c5d8798476 (diff) | |
download | libvirt-python-6c136b8150e1487efdbb10bfd32a5d8a0f84df16.tar.gz |
Add support for virNodeGetSEVInfo
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 <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Diffstat (limited to 'libvirt-override.c')
-rw-r--r-- | libvirt-override.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libvirt-override.c b/libvirt-override.c index 23dd678..012de3f 100644 --- a/libvirt-override.c +++ b/libvirt-override.c @@ -9796,6 +9796,40 @@ libvirt_virDomainGetLaunchSecurityInfo(PyObject *self ATTRIBUTE_UNUSED, virTypedParamsFree(params, nparams); return ret; } + + +static PyObject * +libvirt_virNodeGetSEVInfo(PyObject *self ATTRIBUTE_UNUSED, + PyObject *args) +{ + PyObject *pyobj_conn = NULL; + PyObject *ret = NULL; + + virConnectPtr conn = NULL; + virTypedParameterPtr params = NULL; + int nparams = 0; + unsigned int flags = 0; + int i_retval; + + if (!PyArg_ParseTuple(args, (char *)"OI:virNodeGetSEVInfo", + &pyobj_conn, &flags)) + return NULL; + conn = (virConnectPtr) PyvirConnect_Get(pyobj_conn); + + LIBVIRT_BEGIN_ALLOW_THREADS; + i_retval = virNodeGetSEVInfo(conn, ¶ms, &nparams, flags); + LIBVIRT_END_ALLOW_THREADS; + + if (i_retval < 0) { + ret = VIR_PY_NONE; + goto cleanup; + } + + ret = getPyVirTypedParameter(params, nparams); + cleanup: + virTypedParamsFree(params, nparams); + return ret; +} #endif /* LIBVIR_CHECK_VERSION(4, 5, 0) */ @@ -10037,6 +10071,7 @@ static PyMethodDef libvirtMethods[] = { #endif /* LIBVIR_CHECK_VERSION(4, 4, 0) */ #if LIBVIR_CHECK_VERSION(4, 5, 0) {(char *) "virDomainGetLaunchSecurityInfo", libvirt_virDomainGetLaunchSecurityInfo, METH_VARARGS, NULL}, + {(char *) "virNodeGetSEVInfo", libvirt_virNodeGetSEVInfo, METH_VARARGS, NULL}, #endif /* LIBVIR_CHECK_VERSION(4, 5, 0) */ {NULL, NULL, 0, NULL} }; |