On Mon, 10 Oct 2011 10:55:46 +0100
"Daniel P. Berrange" <berrange(a)redhat.com> wrote:
On Sat, Oct 08, 2011 at 12:07:08AM +0530, Prerna Saxena wrote:
> Libvirt presently depends on /proc/cpuinfo to gather information about
> the x86 host. Parsing of /proc/cpuinfo is arch-specific; the
> information fields are also not consistent.
> A cleaner way would be to use Sysfs. Both x86 and PowerPC specific
> information can be obtained from sysfs with different arch specific
> parsing routines.
>
> ---
> src/nodeinfo.c | 106 +++++++++++++++++++-------------------------------------
> 1 files changed, 36 insertions(+), 70 deletions(-)
>
> diff --git a/src/nodeinfo.c b/src/nodeinfo.c
> index 6448b79..cdd339d 100644
> ...[snip]...
I checked the output of 'virsh nodeinfo' before and after this patch on
RHEL5 and RHEL-6 hosts, and it did not change.
This validates the patch :)
On an x86 system, virsh nodeinfo will give the same output; just that
it will now depend on sysfs for learning about host topology, in place
of /proc/cpuinfo.
On a KVM-ppc64 machine, virsh nodeinfo will now work without having
to write a new parser for parsing /proc/cpuinfo for PowerPC.
When building, however, you get a compiele warning about the unused
parameter 'need_hyperthreads'. How come this was needed before, but
is not used anymore ? If it is redundant, you should remove the
parameter entirely.
Agree, I'll do that in the next series of patches which I send.
Thanks,
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India