summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@cardoe.com>2013-11-13 18:15:23 -0500
committerDaniel P. Berrange <berrange@redhat.com>2013-11-22 15:58:07 +0000
commit810126620a2cd094e8ce0418519cc64fb5c7a7c9 (patch)
tree47307dc23744986969a207b4eca0ab31db5cc40c
parent7cc872b35bc76d387a708998caf6adb5f5c008ef (diff)
downloadlibvirt-python-v9-810126620a2cd094e8ce0418519cc64fb5c7a7c9.zip
libvirt-python-v9-810126620a2cd094e8ce0418519cc64fb5c7a7c9.tar.gz
libvirt-python-v9-810126620a2cd094e8ce0418519cc64fb5c7a7c9.tar.xz
virNodeGetCPUMap API appeared in 1.0.0
-rw-r--r--libvirt-override.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libvirt-override.c b/libvirt-override.c
index 1c9d506..173510e 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -419,12 +419,14 @@ cleanup:
*/
static int
getPyNodeCPUCount(virConnectPtr conn) {
- int i_retval;
+ int i_retval = -1;
virNodeInfo nodeinfo;
+#if LIBVIR_CHECK_VERSION(1, 0, 0)
LIBVIRT_BEGIN_ALLOW_THREADS;
i_retval = virNodeGetCPUMap(conn, NULL, NULL, 0);
LIBVIRT_END_ALLOW_THREADS;
+#endif /* LIBVIR_CHECK_VERSION(1, 0, 0) */
if (i_retval < 0) {
/* fallback: use nodeinfo */
@@ -7088,6 +7090,7 @@ cleanup:
}
#endif /* LIBVIR_CHECK_VERSION(0, 10, 2) */
+#if LIBVIR_CHECK_VERSION(1, 0, 0)
static PyObject *
libvirt_virNodeGetCPUMap(PyObject *self ATTRIBUTE_UNUSED,
PyObject *args)
@@ -7156,6 +7159,7 @@ error:
ret = NULL;
goto cleanup;
}
+#endif /* LIBVIR_CHECK_VERSION(1, 0, 0) */
static PyObject *
@@ -7400,7 +7404,9 @@ static PyMethodDef libvirtMethods[] = {
{(char *) "virNodeGetMemoryParameters", libvirt_virNodeGetMemoryParameters, METH_VARARGS, NULL},
{(char *) "virNodeSetMemoryParameters", libvirt_virNodeSetMemoryParameters, METH_VARARGS, NULL},
#endif /* LIBVIR_CHECK_VERSION(0, 10, 2) */
+#if LIBVIR_CHECK_VERSION(1, 0, 0)
{(char *) "virNodeGetCPUMap", libvirt_virNodeGetCPUMap, METH_VARARGS, NULL},
+#endif /* LIBVIR_CHECK_VERSION(1, 0, 0) */
{(char *) "virDomainCreateXMLWithFiles", libvirt_virDomainCreateXMLWithFiles, METH_VARARGS, NULL},
{(char *) "virDomainCreateWithFiles", libvirt_virDomainCreateWithFiles, METH_VARARGS, NULL},
{NULL, NULL, 0, NULL}