From caec2e43f27afa07b4f279b14046769f4ad0167c Mon Sep 17 00:00:00 2001 Message-Id: <caec2e43f27afa07b4f279b14046769f4ad0167c.1285228537.git.jdenemar@redhat.com> From: Eric Blake <eblake@redhat.com> Date: Wed, 22 Sep 2010 09:08:53 -0600 Subject: [PATCH] nodeinfo: work when hot-plugging is disabled Upstream: https://bugzilla.redhat.com/show_bug.cgi?id=635857 RHEL 5.6: https://bugzilla.redhat.com/show_bug.cgi?id=636347 * src/nodeinfo.c (cpu_online): Allow missing directory for all CPUs, not just cpu0. Signed-off-by: Eric Blake <eblake@redhat.com> (cherry picked from commit be026480f9cdc729f0c35f4d861a5dcda2388098) --- src/nodeinfo.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nodeinfo.c b/src/nodeinfo.c index 65eeb24..3dac9f3 100644 --- a/src/nodeinfo.c +++ b/src/nodeinfo.c @@ -65,7 +65,8 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo, /* Return the positive decimal contents of the given * CPU_SYS_PATH/cpu%u/FILE, or -1 on error. If MISSING_OK and the * file could not be found, return 1 instead of an error; this is - * because some machines cannot hot-unplug cpu0. */ + * because some machines cannot hot-unplug cpu0, or because + * hot-unplugging is disabled. */ static int get_cpu_value(unsigned int cpu, const char *file, bool missing_ok) { @@ -113,7 +114,7 @@ cleanup: static int cpu_online(unsigned int cpu) { - return get_cpu_value(cpu, "online", cpu == 0); + return get_cpu_value(cpu, "online", true); } static unsigned long count_thread_siblings(unsigned int cpu) -- 1.7.3