mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-12-17 16:26:15 +03:00
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
This commit is contained in:
@@ -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}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user