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

[libvirt] [PATCH] Only use the numa functions when they are available.



Signed-off-by: Chris Lalancette <clalance redhat com>
---
 src/nodeinfo.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 8d7e055..bf57517 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -160,10 +160,12 @@ int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo,
     nodeinfo->cpus = 0;
     nodeinfo->mhz = 0;
     nodeinfo->cores = 1;
-    if (numa_available() < 0)
-        nodeinfo->nodes = 1;
-    else
+
+    nodeinfo->nodes = 1;
+#if HAVE_NUMACTL
+    if (numa_available() >= 0)
         nodeinfo->nodes = numa_max_node() + 1;
+#endif
 
     /* NB: It is impossible to fill our nodes, since cpuinfo
      * has no knowledge of NUMA nodes */
-- 
1.6.6.1


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