[libvirt] [libvirt-python PATCH 0/2] Python bindings for virDomainMigrateGetMaxDowntime

Implement the bindings similar to previous such implementations for Compression cache (commit id's 7465d31bb and feae4e052) John Ferlan (2): Introduce virDomainMigrateGetMaxDowntime API Implement virDomainMigrateGetMaxDowntime generator.py | 1 + libvirt-override-api.xml | 7 +++++++ libvirt-override.c | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) -- 2.9.5

Introduce wrapper for virDomainMigrateGetMaxDowntime Signed-off-by: John Ferlan <jferlan@redhat.com> --- generator.py | 1 + 1 file changed, 1 insertion(+) diff --git a/generator.py b/generator.py index 93d1dc3..59e7531 100755 --- a/generator.py +++ b/generator.py @@ -465,6 +465,7 @@ skip_impl = ( 'virDomainGetBlockJobInfo', 'virDomainMigrateGetCompressionCache', 'virDomainMigrateGetMaxSpeed', + 'virDomainMigrateGetMaxDowntime', 'virDomainBlockStatsFlags', 'virDomainSetBlockIoTune', 'virDomainGetBlockIoTune', -- 2.9.5

Add override code for virDomainMigrateGetMaxDowntime Signed-off-by: John Ferlan <jferlan@redhat.com> --- libvirt-override-api.xml | 7 +++++++ libvirt-override.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/libvirt-override-api.xml b/libvirt-override-api.xml index c96e83e..b63a403 100644 --- a/libvirt-override-api.xml +++ b/libvirt-override-api.xml @@ -582,6 +582,13 @@ <arg name='flags' type='unsigned int' info='flags, currently unused, pass 0.'/> <return type='unsigned long' info='current max migration speed, or None in case of error'/> </function> + <function name='virDomainMigrateGetMaxDowntime' file='python'> + <info>Get the current value of the maximum downtime (in milliseconds) + allowed during a migration of a guest.</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 downtime or None in case of error'/> + </function> <function name='virDomainMigrate3' file='python'> <info>Migrate the domain object from its current host to the destination host given by dconn (a connection to the destination host).</info> diff --git a/libvirt-override.c b/libvirt-override.c index 3bc05f1..c04ce2e 100644 --- a/libvirt-override.c +++ b/libvirt-override.c @@ -7663,6 +7663,35 @@ libvirt_virDomainMigrateGetMaxSpeed(PyObject *self ATTRIBUTE_UNUSED, return libvirt_ulongWrap(bandwidth); } +#if LIBVIR_CHECK_VERSION(3, 7, 0) +static PyObject * +libvirt_virDomainMigrateGetMaxDowntime(PyObject *self ATTRIBUTE_UNUSED, + PyObject *args) +{ + PyObject *pyobj_domain; + virDomainPtr domain; + unsigned int flags; + unsigned long long downtime; + int rc; + + if (!PyArg_ParseTuple(args, + (char *) "OI:virDomainMigrateGetMaxDowntime", + &pyobj_domain, &flags)) + return NULL; + + domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain); + + LIBVIRT_BEGIN_ALLOW_THREADS; + rc = virDomainMigrateGetMaxDowntime(domain, &downtime, flags); + LIBVIRT_END_ALLOW_THREADS; + + if (rc < 0) + return VIR_PY_NONE; + + return libvirt_ulonglongWrap(downtime); +} +#endif /* LIBVIR_CHECK_VERSION(3, 7, 0) */ + #if LIBVIR_CHECK_VERSION(1, 1, 0) static PyObject * libvirt_virDomainMigrate3(PyObject *self ATTRIBUTE_UNUSED, @@ -9733,6 +9762,10 @@ static PyMethodDef libvirtMethods[] = { {(char *) "virDomainMigrateGetCompressionCache", libvirt_virDomainMigrateGetCompressionCache, METH_VARARGS, NULL}, #endif /* LIBVIR_CHECK_VERSION(1, 0, 3) */ {(char *) "virDomainMigrateGetMaxSpeed", libvirt_virDomainMigrateGetMaxSpeed, METH_VARARGS, NULL}, +#if LIBVIR_CHECK_VERSION(3, 7, 0) + {(char *) "virDomainMigrateGetMaxDowntime", libvirt_virDomainMigrateGetMaxDowntime, METH_VARARGS, NULL}, +#endif /* LIBVIR_CHECK_VERSION(3, 7, 0) */ + {(char *) "virDomainMigrateGetMaxSpeed", libvirt_virDomainMigrateGetMaxSpeed, METH_VARARGS, NULL}, #if LIBVIR_CHECK_VERSION(1, 1, 0) {(char *) "virDomainMigrate3", libvirt_virDomainMigrate3, METH_VARARGS, NULL}, {(char *) "virDomainMigrateToURI3", libvirt_virDomainMigrateToURI3, METH_VARARGS, NULL}, -- 2.9.5

On 08/26/2017 09:01 AM, John Ferlan wrote:
Implement the bindings similar to previous such implementations for Compression cache (commit id's 7465d31bb and feae4e052)
John Ferlan (2): Introduce virDomainMigrateGetMaxDowntime API Implement virDomainMigrateGetMaxDowntime
generator.py | 1 + libvirt-override-api.xml | 7 +++++++ libvirt-override.c | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+)
I pushed this under the rule of well the CI build is broken and since DV is making a release in his morning - 'tis better to push and have to fix some minor issue in something than have the build failure be a blocking point. John
participants (1)
-
John Ferlan