mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-07-18 04:59:33 +03:00
@ -41,10 +41,10 @@ extern void initcygvirtmod_lxc(void);
|
|||||||
|
|
||||||
#if DEBUG_ERROR
|
#if DEBUG_ERROR
|
||||||
# define DEBUG(fmt, ...) \
|
# define DEBUG(fmt, ...) \
|
||||||
printf(fmt, __VA_ARGS__)
|
printf(fmt, __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
# define DEBUG(fmt, ...) \
|
# define DEBUG(fmt, ...) \
|
||||||
do {} while (0)
|
do {} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@ -114,19 +114,19 @@ static PyMethodDef libvirtLxcMethods[] = {
|
|||||||
|
|
||||||
#if PY_MAJOR_VERSION > 2
|
#if PY_MAJOR_VERSION > 2
|
||||||
static struct PyModuleDef moduledef = {
|
static struct PyModuleDef moduledef = {
|
||||||
PyModuleDef_HEAD_INIT,
|
PyModuleDef_HEAD_INIT,
|
||||||
# ifndef __CYGWIN__
|
# ifndef __CYGWIN__
|
||||||
"libvirtmod_lxc",
|
"libvirtmod_lxc",
|
||||||
# else
|
# else
|
||||||
"cygvirtmod_lxc",
|
"cygvirtmod_lxc",
|
||||||
# endif
|
# endif
|
||||||
NULL,
|
NULL,
|
||||||
-1,
|
-1,
|
||||||
libvirtLxcMethods,
|
libvirtLxcMethods,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
PyObject *
|
PyObject *
|
||||||
@ -135,7 +135,7 @@ PyInit_libvirtmod_lxc
|
|||||||
# else
|
# else
|
||||||
PyInit_cygvirtmod_lxc
|
PyInit_cygvirtmod_lxc
|
||||||
# endif
|
# endif
|
||||||
(void)
|
(void)
|
||||||
{
|
{
|
||||||
PyObject *module;
|
PyObject *module;
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ initlibvirtmod_lxc
|
|||||||
# else
|
# else
|
||||||
initcygvirtmod_lxc
|
initcygvirtmod_lxc
|
||||||
# endif
|
# endif
|
||||||
(void)
|
(void)
|
||||||
{
|
{
|
||||||
if (virInitialize() < 0)
|
if (virInitialize() < 0)
|
||||||
return;
|
return;
|
||||||
@ -165,6 +165,6 @@ initcygvirtmod_lxc
|
|||||||
# else
|
# else
|
||||||
"cygvirtmod_lxc",
|
"cygvirtmod_lxc",
|
||||||
# endif
|
# endif
|
||||||
libvirtLxcMethods);
|
libvirtLxcMethods);
|
||||||
}
|
}
|
||||||
#endif /* ! PY_MAJOR_VERSION > 2 */
|
#endif /* ! PY_MAJOR_VERSION > 2 */
|
||||||
|
@ -45,10 +45,10 @@ extern void initcygvirtmod(void);
|
|||||||
|
|
||||||
#if DEBUG_ERROR
|
#if DEBUG_ERROR
|
||||||
# define DEBUG(fmt, ...) \
|
# define DEBUG(fmt, ...) \
|
||||||
printf(fmt, __VA_ARGS__)
|
printf(fmt, __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
# define DEBUG(fmt, ...) \
|
# define DEBUG(fmt, ...) \
|
||||||
do {} while (0)
|
do {} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ libvirt_virDomainBlockStats(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
PyObject *info;
|
PyObject *info;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, (char *)"Oz:virDomainBlockStats",
|
if (!PyArg_ParseTuple(args, (char *)"Oz:virDomainBlockStats",
|
||||||
&pyobj_domain, &path))
|
&pyobj_domain, &path))
|
||||||
return NULL;
|
return NULL;
|
||||||
domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
|
domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
|
||||||
|
|
||||||
@ -320,7 +320,7 @@ libvirt_virDomainInterfaceStats(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
PyObject *info;
|
PyObject *info;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, (char *)"Oz:virDomainInterfaceStats",
|
if (!PyArg_ParseTuple(args, (char *)"Oz:virDomainInterfaceStats",
|
||||||
&pyobj_domain, &path))
|
&pyobj_domain, &path))
|
||||||
return NULL;
|
return NULL;
|
||||||
domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
|
domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
|
||||||
|
|
||||||
@ -499,7 +499,7 @@ libvirt_virDomainGetSchedulerParameters(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
libvirt_virDomainGetSchedulerParametersFlags(PyObject *self ATTRIBUTE_UNUSED,
|
libvirt_virDomainGetSchedulerParametersFlags(PyObject *self ATTRIBUTE_UNUSED,
|
||||||
PyObject *args)
|
PyObject *args)
|
||||||
{
|
{
|
||||||
virDomainPtr domain;
|
virDomainPtr domain;
|
||||||
PyObject *pyobj_domain;
|
PyObject *pyobj_domain;
|
||||||
@ -1259,10 +1259,10 @@ libvirt_virDomainGetVcpus(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
goto itemError;
|
goto itemError;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
itemError:
|
itemError:
|
||||||
Py_DECREF(info);
|
Py_DECREF(info);
|
||||||
Py_XDECREF(item);
|
Py_XDECREF(item);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
for (i = 0; i < dominfo.nrVirtCpu; i++) {
|
for (i = 0; i < dominfo.nrVirtCpu; i++) {
|
||||||
PyObject *info = PyTuple_New(cpunum);
|
PyObject *info = PyTuple_New(cpunum);
|
||||||
@ -1327,8 +1327,8 @@ libvirt_virDomainPinVcpu(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
if (tuple_size == -1)
|
if (tuple_size == -1)
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
} else {
|
||||||
PyErr_SetString(PyExc_TypeError, "Unexpected type, tuple is required");
|
PyErr_SetString(PyExc_TypeError, "Unexpected type, tuple is required");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
cpumaplen = VIR_CPU_MAPLEN(cpunum);
|
cpumaplen = VIR_CPU_MAPLEN(cpunum);
|
||||||
@ -1392,8 +1392,8 @@ libvirt_virDomainPinVcpuFlags(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
if (tuple_size == -1)
|
if (tuple_size == -1)
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
} else {
|
||||||
PyErr_SetString(PyExc_TypeError, "Unexpected type, tuple is required");
|
PyErr_SetString(PyExc_TypeError, "Unexpected type, tuple is required");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
cpumaplen = VIR_CPU_MAPLEN(cpunum);
|
cpumaplen = VIR_CPU_MAPLEN(cpunum);
|
||||||
@ -1521,8 +1521,8 @@ libvirt_virDomainPinEmulator(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
cpumaplen = VIR_CPU_MAPLEN(cpunum);
|
cpumaplen = VIR_CPU_MAPLEN(cpunum);
|
||||||
|
|
||||||
if (!PyTuple_Check(pycpumap)) {
|
if (!PyTuple_Check(pycpumap)) {
|
||||||
PyErr_SetString(PyExc_TypeError, "Unexpected type, tuple is required");
|
PyErr_SetString(PyExc_TypeError, "Unexpected type, tuple is required");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((tuple_size = PyTuple_Size(pycpumap)) == -1)
|
if ((tuple_size = PyTuple_Size(pycpumap)) == -1)
|
||||||
@ -1890,9 +1890,8 @@ libvirt_virRegisterErrorHandler(ATTRIBUTE_UNUSED PyObject *self,
|
|||||||
PyObject *pyobj_f;
|
PyObject *pyobj_f;
|
||||||
PyObject *pyobj_ctx;
|
PyObject *pyobj_ctx;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple
|
if (!PyArg_ParseTuple(args, (char *) "OO:xmlRegisterErrorHandler",
|
||||||
(args, (char *) "OO:xmlRegisterErrorHandler", &pyobj_f,
|
&pyobj_f, &pyobj_ctx))
|
||||||
&pyobj_ctx))
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
DEBUG("libvirt_virRegisterErrorHandler(%p, %p) called\n", pyobj_ctx,
|
DEBUG("libvirt_virRegisterErrorHandler(%p, %p) called\n", pyobj_ctx,
|
||||||
@ -3203,7 +3202,7 @@ libvirt_virNodeGetCellsFreeMemory(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
py_retval = PyList_New(c_retval);
|
py_retval = PyList_New(c_retval);
|
||||||
for (i = 0; i < c_retval; i++) {
|
for (i = 0; i < c_retval; i++) {
|
||||||
PyList_SetItem(py_retval, i,
|
PyList_SetItem(py_retval, i,
|
||||||
libvirt_ulonglongWrap(freeMems[i]));
|
libvirt_ulonglongWrap(freeMems[i]));
|
||||||
}
|
}
|
||||||
VIR_FREE(freeMems);
|
VIR_FREE(freeMems);
|
||||||
return py_retval;
|
return py_retval;
|
||||||
@ -5103,9 +5102,8 @@ libvirt_virConnectDomainEventRegister(ATTRIBUTE_UNUSED PyObject *self,
|
|||||||
virConnectPtr conn;
|
virConnectPtr conn;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple
|
if (!PyArg_ParseTuple(args, (char *) "OO:virConnectDomainEventRegister",
|
||||||
(args, (char *) "OO:virConnectDomainEventRegister",
|
&pyobj_conn, &pyobj_conn_inst)) {
|
||||||
&pyobj_conn, &pyobj_conn_inst)) {
|
|
||||||
DEBUG("%s failed parsing tuple\n", __FUNCTION__);
|
DEBUG("%s failed parsing tuple\n", __FUNCTION__);
|
||||||
return VIR_PY_INT_FAIL;
|
return VIR_PY_INT_FAIL;
|
||||||
}
|
}
|
||||||
@ -5139,9 +5137,8 @@ libvirt_virConnectDomainEventDeregister(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
virConnectPtr conn;
|
virConnectPtr conn;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple
|
if (!PyArg_ParseTuple(args, (char *) "OO:virConnectDomainEventDeregister",
|
||||||
(args, (char *) "OO:virConnectDomainEventDeregister",
|
&pyobj_conn, &pyobj_conn_inst))
|
||||||
&pyobj_conn, &pyobj_conn_inst))
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
DEBUG("libvirt_virConnectDomainEventDeregister(%p) called\n", pyobj_conn);
|
DEBUG("libvirt_virConnectDomainEventDeregister(%p) called\n", pyobj_conn);
|
||||||
@ -5501,10 +5498,8 @@ libvirt_virEventInvokeHandleCallback(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
virEventHandleCallback cb;
|
virEventHandleCallback cb;
|
||||||
void *opaque;
|
void *opaque;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple
|
if (!PyArg_ParseTuple(args, (char *) "iiiOO:virEventInvokeHandleCallback",
|
||||||
(args, (char *) "iiiOO:virEventInvokeHandleCallback",
|
&watch, &fd, &event, &py_f, &py_opaque))
|
||||||
&watch, &fd, &event, &py_f, &py_opaque
|
|
||||||
))
|
|
||||||
return VIR_PY_INT_FAIL;
|
return VIR_PY_INT_FAIL;
|
||||||
|
|
||||||
cb = (virEventHandleCallback) PyvirEventHandleCallback_Get(py_f);
|
cb = (virEventHandleCallback) PyvirEventHandleCallback_Get(py_f);
|
||||||
@ -5529,10 +5524,8 @@ libvirt_virEventInvokeTimeoutCallback(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
virEventTimeoutCallback cb;
|
virEventTimeoutCallback cb;
|
||||||
void *opaque;
|
void *opaque;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple
|
if (!PyArg_ParseTuple(args, (char *) "iOO:virEventInvokeTimeoutCallback",
|
||||||
(args, (char *) "iOO:virEventInvokeTimeoutCallback",
|
&timer, &py_f, &py_opaque))
|
||||||
&timer, &py_f, &py_opaque
|
|
||||||
))
|
|
||||||
return VIR_PY_INT_FAIL;
|
return VIR_PY_INT_FAIL;
|
||||||
|
|
||||||
cb = (virEventTimeoutCallback) PyvirEventTimeoutCallback_Get(py_f);
|
cb = (virEventTimeoutCallback) PyvirEventTimeoutCallback_Get(py_f);
|
||||||
@ -6703,15 +6696,15 @@ libvirt_virConnectDomainEventRegisterAny(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
virConnectDomainEventGenericCallback cb = NULL;
|
virConnectDomainEventGenericCallback cb = NULL;
|
||||||
virDomainPtr dom;
|
virDomainPtr dom;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple
|
if (!PyArg_ParseTuple(args,
|
||||||
(args, (char *) "OOiO:virConnectDomainEventRegisterAny",
|
(char *) "OOiO:virConnectDomainEventRegisterAny",
|
||||||
&pyobj_conn, &pyobj_dom, &eventID, &pyobj_cbData)) {
|
&pyobj_conn, &pyobj_dom, &eventID, &pyobj_cbData)) {
|
||||||
DEBUG("%s failed parsing tuple\n", __FUNCTION__);
|
DEBUG("%s failed parsing tuple\n", __FUNCTION__);
|
||||||
return VIR_PY_INT_FAIL;
|
return VIR_PY_INT_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG("libvirt_virConnectDomainEventRegister(%p %p %d %p) called\n",
|
DEBUG("libvirt_virConnectDomainEventRegister(%p %p %d %p) called\n",
|
||||||
pyobj_conn, pyobj_dom, eventID, pyobj_cbData);
|
pyobj_conn, pyobj_dom, eventID, pyobj_cbData);
|
||||||
conn = PyvirConnect_Get(pyobj_conn);
|
conn = PyvirConnect_Get(pyobj_conn);
|
||||||
if (pyobj_dom == Py_None)
|
if (pyobj_dom == Py_None)
|
||||||
dom = NULL;
|
dom = NULL;
|
||||||
@ -6825,9 +6818,8 @@ libvirt_virConnectDomainEventDeregisterAny(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
virConnectPtr conn;
|
virConnectPtr conn;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple
|
if (!PyArg_ParseTuple(args, (char *) "Oi:virConnectDomainEventDeregister",
|
||||||
(args, (char *) "Oi:virConnectDomainEventDeregister",
|
&pyobj_conn, &callbackID))
|
||||||
&pyobj_conn, &callbackID))
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
DEBUG("libvirt_virConnectDomainEventDeregister(%p) called\n", pyobj_conn);
|
DEBUG("libvirt_virConnectDomainEventDeregister(%p) called\n", pyobj_conn);
|
||||||
@ -6921,15 +6913,15 @@ libvirt_virConnectNetworkEventRegisterAny(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
virConnectNetworkEventGenericCallback cb = NULL;
|
virConnectNetworkEventGenericCallback cb = NULL;
|
||||||
virNetworkPtr net;
|
virNetworkPtr net;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple
|
if (!PyArg_ParseTuple(args,
|
||||||
(args, (char *) "OOiO:virConnectNetworkEventRegisterAny",
|
(char *) "OOiO:virConnectNetworkEventRegisterAny",
|
||||||
&pyobj_conn, &pyobj_net, &eventID, &pyobj_cbData)) {
|
&pyobj_conn, &pyobj_net, &eventID, &pyobj_cbData)) {
|
||||||
DEBUG("%s failed parsing tuple\n", __FUNCTION__);
|
DEBUG("%s failed parsing tuple\n", __FUNCTION__);
|
||||||
return VIR_PY_INT_FAIL;
|
return VIR_PY_INT_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG("libvirt_virConnectNetworkEventRegister(%p %p %d %p) called\n",
|
DEBUG("libvirt_virConnectNetworkEventRegister(%p %p %d %p) called\n",
|
||||||
pyobj_conn, pyobj_net, eventID, pyobj_cbData);
|
pyobj_conn, pyobj_net, eventID, pyobj_cbData);
|
||||||
conn = PyvirConnect_Get(pyobj_conn);
|
conn = PyvirConnect_Get(pyobj_conn);
|
||||||
if (pyobj_net == Py_None)
|
if (pyobj_net == Py_None)
|
||||||
net = NULL;
|
net = NULL;
|
||||||
@ -6975,9 +6967,8 @@ libvirt_virConnectNetworkEventDeregisterAny(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
virConnectPtr conn;
|
virConnectPtr conn;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple
|
if (!PyArg_ParseTuple(args, (char *) "Oi:virConnectNetworkEventDeregister",
|
||||||
(args, (char *) "Oi:virConnectNetworkEventDeregister",
|
&pyobj_conn, &callbackID))
|
||||||
&pyobj_conn, &callbackID))
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
DEBUG("libvirt_virConnectNetworkEventDeregister(%p) called\n", pyobj_conn);
|
DEBUG("libvirt_virConnectNetworkEventDeregister(%p) called\n", pyobj_conn);
|
||||||
@ -7042,15 +7033,14 @@ libvirt_virConnectRegisterCloseCallback(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
virConnectPtr conn;
|
virConnectPtr conn;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple
|
if (!PyArg_ParseTuple(args, (char *) "OO:virConnectRegisterCloseCallback",
|
||||||
(args, (char *) "OO:virConnectRegisterCloseCallback",
|
&pyobj_conn, &pyobj_cbData)) {
|
||||||
&pyobj_conn, &pyobj_cbData)) {
|
|
||||||
DEBUG("%s failed parsing tuple\n", __FUNCTION__);
|
DEBUG("%s failed parsing tuple\n", __FUNCTION__);
|
||||||
return VIR_PY_INT_FAIL;
|
return VIR_PY_INT_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG("libvirt_virConnectRegisterCloseCallback(%p %p) called\n",
|
DEBUG("libvirt_virConnectRegisterCloseCallback(%p %p) called\n",
|
||||||
pyobj_conn, pyobj_cbData);
|
pyobj_conn, pyobj_cbData);
|
||||||
conn = PyvirConnect_Get(pyobj_conn);
|
conn = PyvirConnect_Get(pyobj_conn);
|
||||||
|
|
||||||
Py_INCREF(pyobj_cbData);
|
Py_INCREF(pyobj_cbData);
|
||||||
@ -7079,9 +7069,8 @@ libvirt_virConnectUnregisterCloseCallback(PyObject * self ATTRIBUTE_UNUSED,
|
|||||||
virConnectPtr conn;
|
virConnectPtr conn;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple
|
if (!PyArg_ParseTuple(args, (char *) "O:virConnectDomainEventUnregister",
|
||||||
(args, (char *) "O:virConnectDomainEventUnregister",
|
&pyobj_conn))
|
||||||
&pyobj_conn))
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
DEBUG("libvirt_virConnectDomainEventUnregister(%p) called\n",
|
DEBUG("libvirt_virConnectDomainEventUnregister(%p) called\n",
|
||||||
@ -8424,7 +8413,7 @@ libvirt_virDomainGetFSInfo(PyObject *self ATTRIBUTE_UNUSED,
|
|||||||
PyObject *py_retval = NULL;
|
PyObject *py_retval = NULL;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, (char *)"Oi:virDomainFSInfo",
|
if (!PyArg_ParseTuple(args, (char *)"Oi:virDomainFSInfo",
|
||||||
&pyobj_domain, &flags))
|
&pyobj_domain, &flags))
|
||||||
return NULL;
|
return NULL;
|
||||||
domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
|
domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
|
||||||
|
|
||||||
@ -8687,19 +8676,19 @@ static PyMethodDef libvirtMethods[] = {
|
|||||||
|
|
||||||
#if PY_MAJOR_VERSION > 2
|
#if PY_MAJOR_VERSION > 2
|
||||||
static struct PyModuleDef moduledef = {
|
static struct PyModuleDef moduledef = {
|
||||||
PyModuleDef_HEAD_INIT,
|
PyModuleDef_HEAD_INIT,
|
||||||
# ifndef __CYGWIN__
|
# ifndef __CYGWIN__
|
||||||
"libvirtmod",
|
"libvirtmod",
|
||||||
# else
|
# else
|
||||||
"cygvirtmod",
|
"cygvirtmod",
|
||||||
# endif
|
# endif
|
||||||
NULL,
|
NULL,
|
||||||
-1,
|
-1,
|
||||||
libvirtMethods,
|
libvirtMethods,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
PyObject *
|
PyObject *
|
||||||
@ -8708,7 +8697,7 @@ PyInit_libvirtmod
|
|||||||
# else
|
# else
|
||||||
PyInit_cygvirtmod
|
PyInit_cygvirtmod
|
||||||
# endif
|
# endif
|
||||||
(void)
|
(void)
|
||||||
{
|
{
|
||||||
PyObject *module;
|
PyObject *module;
|
||||||
|
|
||||||
@ -8726,7 +8715,7 @@ initlibvirtmod
|
|||||||
# else
|
# else
|
||||||
initcygvirtmod
|
initcygvirtmod
|
||||||
# endif
|
# endif
|
||||||
(void)
|
(void)
|
||||||
{
|
{
|
||||||
if (virInitialize() < 0)
|
if (virInitialize() < 0)
|
||||||
return;
|
return;
|
||||||
@ -8738,6 +8727,6 @@ initcygvirtmod
|
|||||||
# else
|
# else
|
||||||
"cygvirtmod",
|
"cygvirtmod",
|
||||||
# endif
|
# endif
|
||||||
libvirtMethods);
|
libvirtMethods);
|
||||||
}
|
}
|
||||||
#endif /* ! PY_MAJOR_VERSION > 2 */
|
#endif /* ! PY_MAJOR_VERSION > 2 */
|
||||||
|
@ -41,10 +41,10 @@ extern void initcygvirtmod_qemu(void);
|
|||||||
|
|
||||||
#if DEBUG_ERROR
|
#if DEBUG_ERROR
|
||||||
# define DEBUG(fmt, ...) \
|
# define DEBUG(fmt, ...) \
|
||||||
printf(fmt, __VA_ARGS__)
|
printf(fmt, __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
# define DEBUG(fmt, ...) \
|
# define DEBUG(fmt, ...) \
|
||||||
do {} while (0)
|
do {} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*******************************************
|
/*******************************************
|
||||||
@ -270,9 +270,8 @@ libvirt_qemu_virConnectDomainQemuMonitorEventRegister(PyObject *self ATTRIBUTE_U
|
|||||||
virDomainPtr dom;
|
virDomainPtr dom;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple
|
if (!PyArg_ParseTuple(args, (char *) "OOzOI", &pyobj_conn, &pyobj_dom,
|
||||||
(args, (char *) "OOzOI",
|
&event, &pyobj_cbData, &flags)) {
|
||||||
&pyobj_conn, &pyobj_dom, &event, &pyobj_cbData, &flags)) {
|
|
||||||
DEBUG("%s failed parsing tuple\n", __FUNCTION__);
|
DEBUG("%s failed parsing tuple\n", __FUNCTION__);
|
||||||
return VIR_PY_INT_FAIL;
|
return VIR_PY_INT_FAIL;
|
||||||
}
|
}
|
||||||
@ -315,9 +314,9 @@ libvirt_qemu_virConnectDomainQemuMonitorEventDeregister(PyObject *self ATTRIBUTE
|
|||||||
virConnectPtr conn;
|
virConnectPtr conn;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple
|
if (!PyArg_ParseTuple(args,
|
||||||
(args, (char *) "Oi:virConnectDomainQemuMonitorEventDeregister",
|
(char *) "Oi:virConnectDomainQemuMonitorEventDeregister",
|
||||||
&pyobj_conn, &callbackID))
|
&pyobj_conn, &callbackID))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
DEBUG("libvirt_qemu_virConnectDomainQemuMonitorEventDeregister(%p) called\n",
|
DEBUG("libvirt_qemu_virConnectDomainQemuMonitorEventDeregister(%p) called\n",
|
||||||
@ -355,19 +354,19 @@ static PyMethodDef libvirtQemuMethods[] = {
|
|||||||
|
|
||||||
#if PY_MAJOR_VERSION > 2
|
#if PY_MAJOR_VERSION > 2
|
||||||
static struct PyModuleDef moduledef = {
|
static struct PyModuleDef moduledef = {
|
||||||
PyModuleDef_HEAD_INIT,
|
PyModuleDef_HEAD_INIT,
|
||||||
# ifndef __CYGWIN__
|
# ifndef __CYGWIN__
|
||||||
"libvirtmod_qemu",
|
"libvirtmod_qemu",
|
||||||
# else
|
# else
|
||||||
"cygvirtmod_qemu",
|
"cygvirtmod_qemu",
|
||||||
# endif
|
# endif
|
||||||
NULL,
|
NULL,
|
||||||
-1,
|
-1,
|
||||||
libvirtQemuMethods,
|
libvirtQemuMethods,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
PyObject *
|
PyObject *
|
||||||
@ -376,7 +375,7 @@ PyInit_libvirtmod_qemu
|
|||||||
# else
|
# else
|
||||||
PyInit_cygvirtmod_qemu
|
PyInit_cygvirtmod_qemu
|
||||||
# endif
|
# endif
|
||||||
(void)
|
(void)
|
||||||
{
|
{
|
||||||
PyObject *module;
|
PyObject *module;
|
||||||
|
|
||||||
@ -394,7 +393,7 @@ initlibvirtmod_qemu
|
|||||||
# else
|
# else
|
||||||
initcygvirtmod_qemu
|
initcygvirtmod_qemu
|
||||||
# endif
|
# endif
|
||||||
(void)
|
(void)
|
||||||
{
|
{
|
||||||
if (virInitialize() < 0)
|
if (virInitialize() < 0)
|
||||||
return;
|
return;
|
||||||
@ -406,6 +405,6 @@ initcygvirtmod_qemu
|
|||||||
# else
|
# else
|
||||||
"cygvirtmod_qemu",
|
"cygvirtmod_qemu",
|
||||||
# endif
|
# endif
|
||||||
libvirtQemuMethods);
|
libvirtQemuMethods);
|
||||||
}
|
}
|
||||||
#endif /* ! PY_MAJOR_VERSION > 2 */
|
#endif /* ! PY_MAJOR_VERSION > 2 */
|
||||||
|
@ -145,10 +145,10 @@ libvirt_constcharPtrWrap(const char *str)
|
|||||||
PyObject *
|
PyObject *
|
||||||
libvirt_boolWrap(int val)
|
libvirt_boolWrap(int val)
|
||||||
{
|
{
|
||||||
if (val)
|
if (val)
|
||||||
Py_RETURN_TRUE;
|
Py_RETURN_TRUE;
|
||||||
else
|
else
|
||||||
Py_RETURN_FALSE;
|
Py_RETURN_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Reference in New Issue
Block a user