Re: [PATCH] nodeinfo: work when hot-plugging is disabled

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

 



On Tue, Sep 21, 2010 at 11:44:03AM -0600, Eric Blake wrote:
> Fixes https://bugzilla.redhat.com/show_bug.cgi?id=635857.
> 
> * src/nodeinfo.c (cpu_online): Allow missing directory for all
> CPUs, not just cpu0.
> 
> Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
> ---
>  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)

ACK

Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

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