[libvirt-python PATCHv2 36/44] virNodeGetCPUMap API appeared in 1.0.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 libvirt-override.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libvirt-override.c b/libvirt-override.c
index 7e167ee..951ad29 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 */
@@ -7095,6 +7097,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)
@@ -7163,6 +7166,7 @@ error:
     ret = NULL;
     goto cleanup;
 }
+#endif /* LIBVIR_CHECK_VERSION(1, 0, 0) */
 
 
 static PyObject *
@@ -7419,7 +7423,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}
-- 
1.8.3.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]