[PATCH 2/2] numa: fix assumption in virNumaNodeIsAvailable()

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

 



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@xxxxxxxxxx>
---
 src/util/virnuma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virnuma.c b/src/util/virnuma.c
index 20f1e56..06520f7 100644
--- a/src/util/virnuma.c
+++ b/src/util/virnuma.c
@@ -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);
 }


-- 
2.1.3

--
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]