[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libvir] virDomainGetInfo returns a false result on IA64 systems

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 :-)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]