[Libvir] virDomainGetInfo returns a false result on IA64 systems

Daniel Veillard veillard at redhat.com
Thu Oct 12 15:31:23 UTC 2006


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 at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/




More information about the libvir-list mailing list