[Libvir] PATCH: Compatability with Xen 3.2.0

In Xen 3.2.0 the physinfo hypercall was changed to remove the field 'sockets_per_node' and add in 'nr_cpus'. We use the sockets_per_node field in livirt for the virNodeInfo struct :-( This patch re-calculates its value in terms of 'nr_cpus / (nodes*cores*threads)' which is how older Xen used to figure it out. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

Daniel P. Berrange wrote:
In Xen 3.2.0 the physinfo hypercall was changed to remove the field 'sockets_per_node' and add in 'nr_cpus'. We use the sockets_per_node field in livirt for the virNodeInfo struct :-( This patch re-calculates its value in terms of 'nr_cpus / (nodes*cores*threads)' which is how older Xen used to figure it out.
Fixes virt-top to work with 3.2.0, so +1 from me. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Mon, Dec 17, 2007 at 07:19:04PM +0000, Daniel P. Berrange wrote:
In Xen 3.2.0 the physinfo hypercall was changed to remove the field 'sockets_per_node' and add in 'nr_cpus'. We use the sockets_per_node field in livirt for the virNodeInfo struct :-( This patch re-calculates its value in terms of 'nr_cpus / (nodes*cores*threads)' which is how older Xen used to figure it out.
Looks fine to me, thanks ! Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Mon, Dec 17, 2007 at 07:19:04PM +0000, Daniel P. Berrange wrote:
In Xen 3.2.0 the physinfo hypercall was changed to remove the field 'sockets_per_node' and add in 'nr_cpus'. We use the sockets_per_node field in livirt for the virNodeInfo struct :-( This patch re-calculates its value in terms of 'nr_cpus / (nodes*cores*threads)' which is how older Xen used to figure it out.
I thought the whole point of that change was that the value was not correct in some cases? I admit I don't know what those cases were, but isn't this just re-introducing that incorrect information? regards john

On Tue, Dec 18, 2007 at 01:03:24AM +0000, John Levon wrote:
On Mon, Dec 17, 2007 at 07:19:04PM +0000, Daniel P. Berrange wrote:
In Xen 3.2.0 the physinfo hypercall was changed to remove the field 'sockets_per_node' and add in 'nr_cpus'. We use the sockets_per_node field in livirt for the virNodeInfo struct :-( This patch re-calculates its value in terms of 'nr_cpus / (nodes*cores*threads)' which is how older Xen used to figure it out.
I thought the whole point of that change was that the value was not correct in some cases? I admit I don't know what those cases were, but isn't this just re-introducing that incorrect information?
Yes & yes. The scenario where it was wrong is where you have a big NUMA system where not all sockets were populated. At the same time though, virNodeInfo is a part of the libvirt public ABI and thus we have to put something in that field. So I'm choosing to continue to the put information which matches the previous semantics, so we're no worse off than we always were. If people really really need accurate info about CPU population, then the new NUMA support in libvirt will give that correct info. Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

On Tue, Dec 18, 2007 at 01:19:16AM +0000, Daniel P. Berrange wrote:
Yes & yes.
The scenario where it was wrong is where you have a big NUMA system where not all sockets were populated.
At the same time though, virNodeInfo is a part of the libvirt public ABI and thus we have to put something in that field. So I'm choosing to continue to the put information which matches the previous semantics, so we're no worse off than we always were.
Fair enough, but could it at least be documented somewhere visible (I suppose the header file would be OK) ?? thanks, john
participants (4)
-
Daniel P. Berrange
-
Daniel Veillard
-
John Levon
-
Richard W.M. Jones