[PATCH 03/10] nodeinfo: Rename linuxParseCPUmax() to linuxParseCPUCount()

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

 



The original name was confusing because the function returns the number
of CPUs, not the maximum CPU id. The comment above the function has
been updated to reflect this.

No functional changes.
---
 src/nodeinfo.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 7a12d54..52f5594 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -976,9 +976,10 @@ linuxGetCPUGlobalPath(const char *sysfs_prefix,
 # define linuxGetCPUOnlinePath(sysfs_prefix)             \
     linuxGetCPUGlobalPath(sysfs_prefix, "online")
 
-/* Determine the maximum cpu id from a Linux sysfs cpu/present file. */
+/* Determine the number of CPUs (maximum CPU id + 1) from a file containing
+ * a list of CPU ids, like the Linux sysfs cpu/present file */
 static int
-linuxParseCPUmax(const char *path)
+linuxParseCPUCount(const char *path)
 {
     char *str = NULL;
     char *tmp;
@@ -1240,7 +1241,7 @@ nodeGetCPUCount(const char *sysfs_prefix ATTRIBUTE_UNUSED)
         return -1;
 
     if (virFileExists(present_path)) {
-        ncpu = linuxParseCPUmax(present_path);
+        ncpu = linuxParseCPUCount(present_path);
         goto cleanup;
     }
 
-- 
2.4.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]