summaryrefslogtreecommitdiffstats
path: root/libvirt-override.c
diff options
context:
space:
mode:
authorJim Fehlig <jfehlig@novell.com>2011-08-26 12:10:21 -0600
committerJim Fehlig <jfehlig@suse.com>2011-09-01 11:26:21 -0600
commitffcb4a3f7c89f15031e6077ad350bf4fc66d571c (patch)
tree76dea002ab00bcfb5ce4f8804f5ddd4109bbdb4e /libvirt-override.c
parent3faa16ef8eadc6c9988bf113e0b22581ea21c3c9 (diff)
downloadlibvirt-python-v6-ffcb4a3f7c89f15031e6077ad350bf4fc66d571c.tar.gz
libvirt-python-v6-ffcb4a3f7c89f15031e6077ad350bf4fc66d571c.tar.xz
libvirt-python-v6-ffcb4a3f7c89f15031e6077ad350bf4fc66d571c.zip
Add public API for getting migration speed
Includes impl of python binding since the generator was not able to cope. Note: Requires gendispatch.pl patch from Matthias Bolte https://www.redhat.com/archives/libvir-list/2011-August/msg01367.html
Diffstat (limited to 'libvirt-override.c')
-rw-r--r--libvirt-override.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libvirt-override.c b/libvirt-override.c
index b5650e2..b020342 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -4543,6 +4543,29 @@ libvirt_virDomainSendKey(PyObject *self ATTRIBUTE_UNUSED,
return py_retval;
}
+static PyObject *
+libvirt_virDomainMigrateGetMaxSpeed(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ int c_retval;
+ unsigned long bandwidth;
+ virDomainPtr domain;
+ PyObject *pyobj_domain;
+
+ if (!PyArg_ParseTuple(args, (char *)"O:virDomainMigrateGetMaxSpeed", &pyobj_domain))
+ return(NULL);
+
+ domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
+
+ LIBVIRT_BEGIN_ALLOW_THREADS;
+ c_retval = virDomainMigrateGetMaxSpeed(domain, &bandwidth, 0);
+ LIBVIRT_END_ALLOW_THREADS;
+
+ if (c_retval < 0)
+ return VIR_PY_INT_FAIL;
+ py_retval = libvirt_ulongWrap(bandwidth);
+ return(py_retval);
+}
+
/************************************************************************
* *
* The registration stuff *
@@ -4632,6 +4655,7 @@ static PyMethodDef libvirtMethods[] = {
{(char *) "virDomainRevertToSnapshot", libvirt_virDomainRevertToSnapshot, METH_VARARGS, NULL},
{(char *) "virDomainGetBlockJobInfo", libvirt_virDomainGetBlockJobInfo, METH_VARARGS, NULL},
{(char *) "virDomainSendKey", libvirt_virDomainSendKey, METH_VARARGS, NULL},
+ {(char *) "virDomainMigrateGetMaxSpeed", libvirt_virDomainMigrateGetMaxSpeed, METH_VARARGS, NULL},
{NULL, NULL, 0, NULL}
};