Re: [PATCH] virsh nodecpustats returns incorrect stats of cpu on Linux when the number of online cpu exceed 9.

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

 



On Mon, Jan 13, 2014 at 06:28:07PM +0800, mars@xxxxxxxxxxxxxxxxxx wrote:
> From: Bing Bu Cao <mars@xxxxxxxxxxxxxxxxxx>
> 
> To retrieve node cpu statistics on Linux system, the
> linuxNodeGetCPUstats function use STRPREFIX() to match the
> cpuid with the cpuid read from /proc/cpustat, it will cause
> obvious error.
> 
> For example:
> 'virsh nodecpustats 12' will display stats of cpu1 if the latter is online.
> 
> This patch fixes this bug.
> 
> Signed-off-by: Bing Bu Cao <mars@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Pradipta Kr. Banerjee <bpradip@xxxxxxxxxx>
> ---
>  src/nodeinfo.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)

Can you also provide a test case to validate this. You just
need to get a suitable /proc/cpustat file and save it in the
tests/ dir and then include linuxNodeGetCPUStats() using that
file.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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