1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-07-24 00:58:54 +03:00

Implement virDomainMigrateGetMaxDowntime

Add override code for virDomainMigrateGetMaxDowntime
This commit is contained in:
John Ferlan
2017-08-26 08:59:24 -04:00
parent 100177c3dc
commit 213ee4d7ae
2 changed files with 40 additions and 0 deletions

View File

@ -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>

View File

@ -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},