diff options
author | Jiri Denemark <jdenemar@redhat.com> | 2013-02-18 23:20:48 +0100 |
---|---|---|
committer | Jiri Denemark <jdenemar@redhat.com> | 2013-02-22 17:35:59 +0100 |
commit | 7465d31bbd7388938c90556dcb470085918c00f5 (patch) | |
tree | b699189ca63ff1dac123dbc860aaa70238e16670 | |
parent | feae4e052489e247b2885704efb221f33039983f (diff) | |
download | libvirt-python-7465d31bbd7388938c90556dcb470085918c00f5.tar.gz |
python: Implement virDomainMigrateGetCompressionCache wrapperv1.0.3-rc2v1.0.3-rc1
-rw-r--r-- | libvirt-override-api.xml | 7 | ||||
-rw-r--r-- | libvirt-override.c | 28 |
2 files changed, 35 insertions, 0 deletions
diff --git a/libvirt-override-api.xml b/libvirt-override-api.xml index 446cdbd..5976fb2 100644 --- a/libvirt-override-api.xml +++ b/libvirt-override-api.xml @@ -491,6 +491,13 @@ <arg name='flags' type='unsigned int' info='fine-tuning flags, currently unused, pass 0.'/> <return type='virDomainBlockJobInfo' info='A dictionary containing job information.' /> </function> + <function name='virDomainMigrateGetCompressionCache' file='python'> + <info>Get current size of the cache (in bytes) used for compressing + repeatedly transferred memory pages during live migration.</info> + <arg name='domain' type='virDomainPtr' info='a domain object'/> + <arg name='flags' type='unsigned int' info='flags, currently unused, pass 0.'/> + <return type='unsigned long long' info='current cache size, or None in case of error'/> + </function> <function name='virDomainMigrateGetMaxSpeed' file='python'> <info>Get currently configured maximum migration speed for a domain</info> <arg name='domain' type='virDomainPtr' info='a domain object'/> diff --git a/libvirt-override.c b/libvirt-override.c index ebd6878..9637598 100644 --- a/libvirt-override.c +++ b/libvirt-override.c @@ -6322,6 +6322,33 @@ libvirt_virDomainSendKey(PyObject *self ATTRIBUTE_UNUSED, } static PyObject * +libvirt_virDomainMigrateGetCompressionCache(PyObject *self ATTRIBUTE_UNUSED, + PyObject *args) +{ + PyObject *pyobj_domain; + virDomainPtr domain; + unsigned int flags; + unsigned long long cacheSize; + int rc; + + if (!PyArg_ParseTuple(args, + (char *) "Oi:virDomainMigrateGetCompressionCache", + &pyobj_domain, &flags)) + return VIR_PY_NONE; + + domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain); + + LIBVIRT_BEGIN_ALLOW_THREADS; + rc = virDomainMigrateGetCompressionCache(domain, &cacheSize, flags); + LIBVIRT_END_ALLOW_THREADS; + + if (rc < 0) + return VIR_PY_NONE; + + return libvirt_ulonglongWrap(cacheSize); +} + +static PyObject * libvirt_virDomainMigrateGetMaxSpeed(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval; int c_retval; @@ -6724,6 +6751,7 @@ static PyMethodDef libvirtMethods[] = { {(char *) "virDomainSetBlockIoTune", libvirt_virDomainSetBlockIoTune, METH_VARARGS, NULL}, {(char *) "virDomainGetBlockIoTune", libvirt_virDomainGetBlockIoTune, METH_VARARGS, NULL}, {(char *) "virDomainSendKey", libvirt_virDomainSendKey, METH_VARARGS, NULL}, + {(char *) "virDomainMigrateGetCompressionCache", libvirt_virDomainMigrateGetCompressionCache, METH_VARARGS, NULL}, {(char *) "virDomainMigrateGetMaxSpeed", libvirt_virDomainMigrateGetMaxSpeed, METH_VARARGS, NULL}, {(char *) "virDomainBlockPeek", libvirt_virDomainBlockPeek, METH_VARARGS, NULL}, {(char *) "virDomainMemoryPeek", libvirt_virDomainMemoryPeek, METH_VARARGS, NULL}, |