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 01/14/2014 09:40 PM, Daniel P. Berrange wrote:
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.
I found there is no test case for linuxNodeGetCPUStats() right now, it is 'static' there. I think adding a new test case to validate linuxNodeGetCPUStats() should not only cover this patch.

What do you think posting another patch to adding the test case?


Daniel



--
Best Regards,
Bing Bu Cao

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