diff --git a/python/generator.py b/python/generator.py
index 0b321169a03e0002b558a02f24394a168de3d326..3fd7f90f8e7cd5cd646199ec852de633ee980ef7 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -260,13 +260,13 @@ skip_impl = (
'virConnectListDefinedDomains',
'virConnectListNetworks',
'virConnectListDefinedNetworks',
- 'virConnectListInterfaces',
- 'virConnectListDefinedInterfaces',
'virConnectListSecrets',
+ 'virConnectListInterfaces',
'virConnectListStoragePools',
'virConnectListDefinedStoragePools',
'virConnectListStorageVols',
'virConnectListDefinedStorageVols',
+ 'virConnectListDefinedInterfaces',
'virConnGetLastError',
'virGetLastError',
'virDomainGetInfo',
diff --git a/python/libvirt-override-api.xml b/python/libvirt-override-api.xml
index 4e551825c69d8007b84c81736b34b43150f19da7..96958b5b1cc17063e4cf63232d01ba3bb5c3e55e 100644
--- a/python/libvirt-override-api.xml
+++ b/python/libvirt-override-api.xml
@@ -211,5 +211,15 @@
+
+ list the running interfaces, stores the pointers to the names in @names
+
+
+
+
+ list the defined interfaces, stores the pointers to the names in @names
+
+
+
diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index 20037efc5ccda77c148092cfdd8dd6527e70a60e..b885190c9a68b9fd008272996f51064db0983a53 100644
--- a/python/libvirt-override.c
+++ b/python/libvirt-override.c
@@ -1761,6 +1761,106 @@ libvirt_virSecretSetValue(PyObject *self ATTRIBUTE_UNUSED,
return py_retval;
}
+static PyObject *
+libvirt_virConnectListInterfaces(PyObject *self ATTRIBUTE_UNUSED,
+ PyObject *args) {
+ PyObject *py_retval;
+ char **names = NULL;
+ int c_retval, i;
+ virConnectPtr conn;
+ PyObject *pyobj_conn;
+
+
+ if (!PyArg_ParseTuple(args, (char *)"O:virConnectListInterfaces", &pyobj_conn))
+ return(NULL);
+ conn = (virConnectPtr) PyvirConnect_Get(pyobj_conn);
+
+ c_retval = virConnectNumOfInterfaces(conn);
+ if (c_retval < 0)
+ return VIR_PY_NONE;
+
+ if (c_retval) {
+ names = malloc(sizeof(*names) * c_retval);
+ if (!names)
+ return VIR_PY_NONE;
+ c_retval = virConnectListInterfaces(conn, names, c_retval);
+ if (c_retval < 0) {
+ free(names);
+ return VIR_PY_NONE;
+ }
+ }
+ py_retval = PyList_New(c_retval);
+ if (py_retval == NULL) {
+ if (names) {
+ for (i = 0;i < c_retval;i++)
+ free(names[i]);
+ free(names);
+ }
+ return VIR_PY_NONE;
+ }
+
+ if (names) {
+ for (i = 0;i < c_retval;i++) {
+ PyList_SetItem(py_retval, i, libvirt_constcharPtrWrap(names[i]));
+ free(names[i]);
+ }
+ free(names);
+ }
+
+ return(py_retval);
+}
+
+
+static PyObject *
+libvirt_virConnectListDefinedInterfaces(PyObject *self ATTRIBUTE_UNUSED,
+ PyObject *args) {
+ PyObject *py_retval;
+ char **names = NULL;
+ int c_retval, i;
+ virConnectPtr conn;
+ PyObject *pyobj_conn;
+
+
+ if (!PyArg_ParseTuple(args, (char *)"O:virConnectListDefinedInterfaces",
+ &pyobj_conn))
+ return(NULL);
+ conn = (virConnectPtr) PyvirConnect_Get(pyobj_conn);
+
+ c_retval = virConnectNumOfDefinedInterfaces(conn);
+ if (c_retval < 0)
+ return VIR_PY_NONE;
+
+ if (c_retval) {
+ names = malloc(sizeof(*names) * c_retval);
+ if (!names)
+ return VIR_PY_NONE;
+ c_retval = virConnectListDefinedInterfaces(conn, names, c_retval);
+ if (c_retval < 0) {
+ free(names);
+ return VIR_PY_NONE;
+ }
+ }
+ py_retval = PyList_New(c_retval);
+ if (py_retval == NULL) {
+ if (names) {
+ for (i = 0;i < c_retval;i++)
+ free(names[i]);
+ free(names);
+ }
+ return VIR_PY_NONE;
+ }
+
+ if (names) {
+ for (i = 0;i < c_retval;i++) {
+ PyList_SetItem(py_retval, i, libvirt_constcharPtrWrap(names[i]));
+ free(names[i]);
+ }
+ free(names);
+ }
+
+ return(py_retval);
+}
+
/*******************************************
* Helper functions to avoid importing modules
* for every callback
@@ -2472,6 +2572,8 @@ static PyMethodDef libvirtMethods[] = {
{(char *) "virConnectListSecrets", libvirt_virConnectListSecrets, METH_VARARGS, NULL},
{(char *) "virSecretGetValue", libvirt_virSecretGetValue, METH_VARARGS, NULL},
{(char *) "virSecretSetValue", libvirt_virSecretSetValue, METH_VARARGS, NULL},
+ {(char *) "virConnectListInterfaces", libvirt_virConnectListInterfaces, METH_VARARGS, NULL},
+ {(char *) "virConnectListDefinedInterfaces", libvirt_virConnectListDefinedInterfaces, METH_VARARGS, NULL},
{NULL, NULL, 0, NULL}
};