mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-11-27 20:23:47 +03:00
override: domain: Implement override for virDomainGetAutostartOnce()
The bindings generator can't generate proper bindings for virDomainGetAutostartOnce() (because of int* in the arguments) so implement it manually. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
@@ -440,6 +440,7 @@ skip_impl = {
|
||||
'virNodeDeviceGetAutostart',
|
||||
'virDomainSaveParams',
|
||||
'virDomainRestoreParams',
|
||||
'virDomainGetAutostartOnce',
|
||||
|
||||
'virDomainLxcOpenNamespace',
|
||||
|
||||
|
||||
@@ -866,5 +866,10 @@
|
||||
<arg name='params' type='virTypedParameterPtr' info='pointer to save parameter objects'/>
|
||||
<arg name='flags' type='int' info='an OR'ed set of virDomainSaveRestoreFlags'/>
|
||||
</function>
|
||||
<function name='virDomainGetAutostartOnce' file='python'>
|
||||
<info>Provides a boolean value indicating whether the domain is configured to be automatically started the next time the host machine boots only.</info>
|
||||
<return type='int' info='the autostart flag, or None in case of error'/>
|
||||
<arg name='domain' type='virDomainPtr' info='a network object'/>
|
||||
</function>
|
||||
</symbols>
|
||||
</api>
|
||||
|
||||
@@ -10913,6 +10913,32 @@ libvirt_virDomainFDAssociate(PyObject *self ATTRIBUTE_UNUSED,
|
||||
#endif /* LIBVIR_CHECK_VERSION(9, 0, 0) */
|
||||
|
||||
|
||||
#if LIBVIR_CHECK_VERSION(11, 2, 0)
|
||||
static PyObject *
|
||||
libvirt_virDomainGetAutostartOnce(PyObject *self ATTRIBUTE_UNUSED,
|
||||
PyObject *args)
|
||||
{
|
||||
int c_retval, autostart;
|
||||
virDomainPtr domain;
|
||||
PyObject *pyobj_domain;
|
||||
|
||||
if (!PyArg_ParseTuple(args, (char *)"O:virDomainGetAutostartOnce",
|
||||
&pyobj_domain))
|
||||
return NULL;
|
||||
|
||||
domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
|
||||
|
||||
LIBVIRT_BEGIN_ALLOW_THREADS;
|
||||
c_retval = virDomainGetAutostartOnce(domain, &autostart);
|
||||
LIBVIRT_END_ALLOW_THREADS;
|
||||
|
||||
if (c_retval < 0)
|
||||
return VIR_PY_INT_FAIL;
|
||||
|
||||
return libvirt_intWrap(autostart);
|
||||
}
|
||||
#endif /* LIBVIR_CHECK_VERSION(11, 2, 0) */
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
@@ -11198,6 +11224,9 @@ static PyMethodDef libvirtMethods[] = {
|
||||
#if LIBVIR_CHECK_VERSION(9, 0, 0)
|
||||
{(char *) "virDomainFDAssociate", libvirt_virDomainFDAssociate, METH_VARARGS, NULL},
|
||||
#endif /* LIBVIR_CHECK_VERSION(9, 0, 0) */
|
||||
#if LIBVIR_CHECK_VERSION(11, 2, 0)
|
||||
{(char *) "virDomainGetAutostartOnce", libvirt_virDomainGetAutostartOnce, METH_VARARGS, NULL},
|
||||
#endif /* LIBVIR_CHECK_VERSION(11, 2, 0) */
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user