mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
Mostly revert "python: remove virConnectGetCPUModelNames from globals"
This reverts commit 6b90d7428d
.
The original problem was that libvirt_virConnectGetCPUModelNames
was listed twice in the exports table, once automatically from
the generator and once from the manual override. We merely needed
to list it in the skip_impl list, and not delete the manually
written code entirely.
This commit is contained in:
parent
9846402116
commit
bae383f291
@ -2276,6 +2276,58 @@ libvirt_virConnectGetVersion(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
return PyInt_FromLong(hvVersion);
|
return PyInt_FromLong(hvVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject *
|
||||||
|
libvirt_virConnectGetCPUModelNames(PyObject *self ATTRIBUTE_UNUSED,
|
||||||
|
PyObject *args)
|
||||||
|
{
|
||||||
|
int c_retval;
|
||||||
|
virConnectPtr conn;
|
||||||
|
PyObject *rv = NULL, *pyobj_conn;
|
||||||
|
char **models = NULL;
|
||||||
|
size_t i;
|
||||||
|
int flags = 0;
|
||||||
|
const char *arch = NULL;
|
||||||
|
|
||||||
|
if (!PyArg_ParseTuple(args, (char *)"Osi:virConnectGetCPUModelNames",
|
||||||
|
&pyobj_conn, &arch, &flags))
|
||||||
|
return NULL;
|
||||||
|
conn = (virConnectPtr) PyvirConnect_Get(pyobj_conn);
|
||||||
|
|
||||||
|
LIBVIRT_BEGIN_ALLOW_THREADS;
|
||||||
|
|
||||||
|
c_retval = virConnectGetCPUModelNames(conn, arch, &models, flags);
|
||||||
|
|
||||||
|
LIBVIRT_END_ALLOW_THREADS;
|
||||||
|
|
||||||
|
if (c_retval == -1)
|
||||||
|
return VIR_PY_INT_FAIL;
|
||||||
|
|
||||||
|
if ((rv = PyList_New(c_retval)) == NULL)
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
for (i = 0; i < c_retval; i++) {
|
||||||
|
PyObject *str;
|
||||||
|
if ((str = PyString_FromString(models[i])) == NULL)
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
PyList_SET_ITEM(rv, i, str);
|
||||||
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
|
if (models) {
|
||||||
|
for (i = 0; i < c_retval; i++)
|
||||||
|
VIR_FREE(models[i]);
|
||||||
|
VIR_FREE(models);
|
||||||
|
}
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
error:
|
||||||
|
Py_XDECREF(rv);
|
||||||
|
rv = VIR_PY_INT_FAIL;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
libvirt_virConnectGetLibVersion(PyObject *self ATTRIBUTE_UNUSED,
|
libvirt_virConnectGetLibVersion(PyObject *self ATTRIBUTE_UNUSED,
|
||||||
PyObject *args)
|
PyObject *args)
|
||||||
@ -7176,6 +7228,7 @@ static PyMethodDef libvirtMethods[] = {
|
|||||||
#include "libvirt-export.c"
|
#include "libvirt-export.c"
|
||||||
{(char *) "virGetVersion", libvirt_virGetVersion, METH_VARARGS, NULL},
|
{(char *) "virGetVersion", libvirt_virGetVersion, METH_VARARGS, NULL},
|
||||||
{(char *) "virConnectGetVersion", libvirt_virConnectGetVersion, METH_VARARGS, NULL},
|
{(char *) "virConnectGetVersion", libvirt_virConnectGetVersion, METH_VARARGS, NULL},
|
||||||
|
{(char *) "virConnectGetCPUModelNames", libvirt_virConnectGetCPUModelNames, METH_VARARGS, NULL},
|
||||||
{(char *) "virConnectGetLibVersion", libvirt_virConnectGetLibVersion, METH_VARARGS, NULL},
|
{(char *) "virConnectGetLibVersion", libvirt_virConnectGetLibVersion, METH_VARARGS, NULL},
|
||||||
{(char *) "virConnectOpenAuth", libvirt_virConnectOpenAuth, METH_VARARGS, NULL},
|
{(char *) "virConnectOpenAuth", libvirt_virConnectOpenAuth, METH_VARARGS, NULL},
|
||||||
{(char *) "virConnectListDomainsID", libvirt_virConnectListDomainsID, METH_VARARGS, NULL},
|
{(char *) "virConnectListDomainsID", libvirt_virConnectListDomainsID, METH_VARARGS, NULL},
|
||||||
|
Loading…
Reference in New Issue
Block a user