On 09/24/2015 10:01 AM, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
libvirt-override.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/libvirt-override.c b/libvirt-override.c
index 114104b..b18196f 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -476,27 +476,22 @@ cleanup:
*/
static int
getPyNodeCPUCount(virConnectPtr conn) {
- int i_retval = -1;
+ int i_retval;
virNodeInfo nodeinfo;
'nodeinfo' is only valid for < 1, 0, 0 - there's a build error for me on
this.
John
#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 */
- LIBVIRT_BEGIN_ALLOW_THREADS;
- i_retval = virNodeGetInfo(conn, &nodeinfo);
- LIBVIRT_END_ALLOW_THREADS;
- if (i_retval < 0)
- goto cleanup;
+#else /* fallback: use nodeinfo */
+ LIBVIRT_BEGIN_ALLOW_THREADS;
+ i_retval = virNodeGetInfo(conn, &nodeinfo);
+ LIBVIRT_END_ALLOW_THREADS;
+ if (i_retval >= 0)
i_retval = VIR_NODEINFO_MAXCPUS(nodeinfo);
- }
+#endif /* LIBVIR_CHECK_VERSION(1, 0, 0) */
-cleanup:
return i_retval;
}