]> xenbits.xensource.com Git - libvirt.git/commitdiff
numa: fix assumption in virNumaNodeIsAvailable()
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 6 Nov 2014 11:17:10 +0000 (12:17 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 6 Nov 2014 14:13:55 +0000 (15:13 +0100)
When compiled without full numa support, the stub function for
virNumaNodeIsAvailable() just checks whether specified node is in range
<0, max); where max is maximum NUMA node available on the host.  But
because the maximum node number is the highest usabe number (and not the
count of nodes), the check is incorrect as it should check whether the
specified node is in range <0, max> instead.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/util/virnuma.c

index 20f1e564b2b47de9a4332a88dbcaebb8ff131814..06520f78eb173214a62b13e91993784c2bb97cd4 100644 (file)
@@ -460,7 +460,7 @@ virNumaNodeIsAvailable(int node)
         return false;
 
     /* Do we have anything better? */
-    return (node >= 0) && (node < max_node);
+    return (node >= 0) && (node <= max_node);
 }