mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 02:51:16 +00:00
Added vir*GetAutostart APIs to python
This commit is contained in:
parent
634d655c1e
commit
7fd0878c40
@ -1,3 +1,8 @@
|
||||
Tue Apr 10 19:15:29 EST 2007 Daniel P. Berrange <berrange@redhat.com>
|
||||
|
||||
* python/libvir.c, python/libvirt-python-api.xml: Added manual
|
||||
impl of the vir*GetAutoStart API methods since generator fails.
|
||||
|
||||
Tue Apr 10 20:39:29 CEST 2007 Daniel Veillard <veillard@redhat.com>
|
||||
|
||||
* src/virsh.c: fixed some typos reported by translator
|
||||
|
@ -570,6 +570,56 @@ libvirt_virNetworkLookupByUUID(PyObject *self ATTRIBUTE_UNUSED, PyObject *args)
|
||||
}
|
||||
|
||||
|
||||
PyObject *
|
||||
libvirt_virDomainGetAutostart(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
|
||||
PyObject *py_retval;
|
||||
int c_retval, autostart;
|
||||
virDomainPtr domain;
|
||||
PyObject *pyobj_domain;
|
||||
|
||||
if (!PyArg_ParseTuple(args, (char *)"O:virDomainGetAutostart", &pyobj_domain))
|
||||
return(NULL);
|
||||
|
||||
domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
|
||||
|
||||
LIBVIRT_BEGIN_ALLOW_THREADS;
|
||||
c_retval = virDomainGetAutostart(domain, &autostart);
|
||||
LIBVIRT_END_ALLOW_THREADS;
|
||||
|
||||
if (c_retval < 0) {
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
py_retval = libvirt_intWrap(autostart);
|
||||
return(py_retval);
|
||||
}
|
||||
|
||||
|
||||
PyObject *
|
||||
libvirt_virNetworkGetAutostart(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
|
||||
PyObject *py_retval;
|
||||
int c_retval, autostart;
|
||||
virNetworkPtr network;
|
||||
PyObject *pyobj_network;
|
||||
|
||||
if (!PyArg_ParseTuple(args, (char *)"O:virNetworkGetAutostart", &pyobj_network))
|
||||
return(NULL);
|
||||
|
||||
network = (virNetworkPtr) PyvirNetwork_Get(pyobj_network);
|
||||
|
||||
LIBVIRT_BEGIN_ALLOW_THREADS;
|
||||
c_retval = virNetworkGetAutostart(network, &autostart);
|
||||
LIBVIRT_END_ALLOW_THREADS;
|
||||
|
||||
if (c_retval < 0) {
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
py_retval = libvirt_intWrap(autostart);
|
||||
return(py_retval);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
@ -594,6 +644,8 @@ static PyMethodDef libvirtMethods[] = {
|
||||
{(char *) "virConnectListDefinedNetworks", libvirt_virConnectListDefinedNetworks, METH_VARARGS, NULL},
|
||||
{(char *) "virNetworkGetUUID", libvirt_virNetworkGetUUID, METH_VARARGS, NULL},
|
||||
{(char *) "virNetworkLookupByUUID", libvirt_virNetworkLookupByUUID, METH_VARARGS, NULL},
|
||||
{(char *) "virDomainGetAutostart", libvirt_virDomainGetAutostart, METH_VARARGS, NULL},
|
||||
{(char *) "virNetworkGetAutostart", libvirt_virNetworkGetAutostart, METH_VARARGS, NULL},
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
|
@ -53,5 +53,15 @@
|
||||
<return type='char *' info='the 16 bytes string or None in case of error'/>
|
||||
<arg name='domain' type='virNetworkPtr' info='a network object'/>
|
||||
</function>
|
||||
<function name='virNetworkGetAutostart' file='python'>
|
||||
<info>Extract the autostart flag for a network.</info>
|
||||
<return type='int' info='the autostart flag, or None in case of error'/>
|
||||
<arg name='domain' type='virNetworkPtr' info='a network object'/>
|
||||
</function>
|
||||
<function name='virDomainGetAutostart' file='python'>
|
||||
<info>Extract the autostart flag for a domain</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>
|
||||
|
Loading…
Reference in New Issue
Block a user