[Libvir] virDomainGetInfo returns a false result on IA64 systems

The maxMem and memory fields of the virDomainInfo structure are false on IA64 systems. The problem is in xen_internal.c at lines 1530,1531: info->memory = XEN_GETDOMAININFO_TOT_PAGES(dominfo) * 4; info->maxMem = XEN_GETDOMAININFO_MAX_PAGES(dominfo) * 4; It's assumed that page size is 4 KB (* 4) but this isn't correct on a IA64 system where the page size is variable. I haven't checked but I suppose this bug exists also with the virDomainGetMaxMemory and virDomainSetMaxMemory functions. Regards.

In Xen-unstable (future Xen 3.0.3), the page size has been added in the "xm info" command: xen_pagesize : 16384 I think that this big problem can't be easily resolved in libvirt while Xen 3.0.3 isn't delivered. Perhaps, a temporary solution would be to consider page size as 16 KB on IA64 ? Philippe Berthault a écrit :
The maxMem and memory fields of the virDomainInfo structure are false on IA64 systems.
The problem is in xen_internal.c at lines 1530,1531: info->memory = XEN_GETDOMAININFO_TOT_PAGES(dominfo) * 4; info->maxMem = XEN_GETDOMAININFO_MAX_PAGES(dominfo) * 4;
It's assumed that page size is 4 KB (* 4) but this isn't correct on a IA64 system where the page size is variable.
I haven't checked but I suppose this bug exists also with the virDomainGetMaxMemory and virDomainSetMaxMemory functions.
Regards.
-- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Thu, Oct 12, 2006 at 05:17:20PM +0200, Philippe Berthault wrote:
In Xen-unstable (future Xen 3.0.3), the page size has been added in the "xm info" command: xen_pagesize : 16384
I think that this big problem can't be easily resolved in libvirt while Xen 3.0.3 isn't delivered. Perhaps, a temporary solution would be to consider page size as 16 KB on IA64 ?
DV has already fixed the problem you noted below in xen_internal.c in the current CVS source. There is a well-define POSIX API to determining system page size: sysconf(_SC_PAGESIZE) so there is no need to hard code anything.
Philippe Berthault a écrit :
The maxMem and memory fields of the virDomainInfo structure are false on IA64 systems.
The problem is in xen_internal.c at lines 1530,1531: info->memory = XEN_GETDOMAININFO_TOT_PAGES(dominfo) * 4; info->maxMem = XEN_GETDOMAININFO_MAX_PAGES(dominfo) * 4;
It's assumed that page size is 4 KB (* 4) but this isn't correct on a IA64 system where the page size is variable.
I haven't checked but I suppose this bug exists also with the virDomainGetMaxMemory and virDomainSetMaxMemory functions.
It looks like those methods work in terms of KB, rather than pages so should be OK, but its worthwhile testing them on IA64 to be certain because neither myself nor DV have any ia64 boxes to test on. 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 Thu, Oct 12, 2006 at 04:58:16PM +0200, Philippe Berthault wrote:
The maxMem and memory fields of the virDomainInfo structure are false on IA64 systems.
The problem is in xen_internal.c at lines 1530,1531: info->memory = XEN_GETDOMAININFO_TOT_PAGES(dominfo) * 4; info->maxMem = XEN_GETDOMAININFO_MAX_PAGES(dominfo) * 4;
Fixed in CVS: paphio:~/libvirt/src -> grep kb_per_pages xen_internal.c static int kb_per_pages = 0; if (kb_per_pages == 0) { kb_per_pages = sysconf(_SC_PAGESIZE) / 1024; if (kb_per_pages <= 0) kb_per_pages = 4; info->memory = XEN_GETDOMAININFO_TOT_PAGES(dominfo) * kb_per_pages; info->maxMem = XEN_GETDOMAININFO_MAX_PAGES(dominfo) * kb_per_pages; paphio:~/libvirt/src -> if you're a developper, use the CVS version or the CVS snapshots, it helps :-)
It's assumed that page size is 4 KB (* 4) but this isn't correct on a IA64 system where the page size is variable.
I haven't checked but I suppose this bug exists also with the virDomainGetMaxMemory and virDomainSetMaxMemory functions.
virDomainGetMaxMemory version from xen_internals.c had to be fixed too I forgot about that one, for xenHypervisorSetMaxMemory() it's fine since the hypercall takes directly the size in kilobytes: uint64_t max_memkb; thanks for raising this again though, there was still a bug around :-) 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/

Thanks a lot, it's now OK on my IA64 system with your CVS code. :-) Daniel Veillard a écrit :
On Thu, Oct 12, 2006 at 04:58:16PM +0200, Philippe Berthault wrote:
The maxMem and memory fields of the virDomainInfo structure are false on IA64 systems.
The problem is in xen_internal.c at lines 1530,1531: info->memory = XEN_GETDOMAININFO_TOT_PAGES(dominfo) * 4; info->maxMem = XEN_GETDOMAININFO_MAX_PAGES(dominfo) * 4;
Fixed in CVS:
paphio:~/libvirt/src -> grep kb_per_pages xen_internal.c static int kb_per_pages = 0; if (kb_per_pages == 0) { kb_per_pages = sysconf(_SC_PAGESIZE) / 1024; if (kb_per_pages <= 0) kb_per_pages = 4; info->memory = XEN_GETDOMAININFO_TOT_PAGES(dominfo) * kb_per_pages; info->maxMem = XEN_GETDOMAININFO_MAX_PAGES(dominfo) * kb_per_pages; paphio:~/libvirt/src ->
if you're a developper, use the CVS version or the CVS snapshots, it helps :-)
It's assumed that page size is 4 KB (* 4) but this isn't correct on a IA64 system where the page size is variable.
I haven't checked but I suppose this bug exists also with the virDomainGetMaxMemory and virDomainSetMaxMemory functions.
virDomainGetMaxMemory version from xen_internals.c had to be fixed too I forgot about that one, for xenHypervisorSetMaxMemory() it's fine since the hypercall takes directly the size in kilobytes:
uint64_t max_memkb;
thanks for raising this again though, there was still a bug around :-)
Daniel
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Philippe Berthault