* src/xen_internal.c: one of the fix for system with page size != 4k

was missing
Daniel
This commit is contained in:
Daniel Veillard 2006-10-12 16:25:51 +00:00
parent 321c24bb00
commit 5533a01af3
2 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Thu Oct 12 17:31:13 CEST 2006 Daniel Veillard <veillard@redhat.com>
* src/xen_internal.c: one of the fix for system with page size != 4k
was missing
Thu Oct 12 13:37:24 CEST 2006 Daniel Veillard <veillard@redhat.com>
* src/xen_internal.c: applied patch from Philippe Berthault

View File

@ -1466,6 +1466,12 @@ xenHypervisorGetDomMaxMemory(virConnectPtr conn, int id)
if ((conn == NULL) || (conn->handle < 0))
return (0);
if (kb_per_pages == 0) {
kb_per_pages = sysconf(_SC_PAGESIZE) / 1024;
if (kb_per_pages <= 0)
kb_per_pages = 4;
}
XEN_GETDOMAININFO_CLEAR(dominfo);
ret = virXen_getdomaininfo(conn->handle, id, &dominfo);
@ -1473,7 +1479,7 @@ xenHypervisorGetDomMaxMemory(virConnectPtr conn, int id)
if ((ret < 0) || (XEN_GETDOMAININFO_DOMAIN(dominfo) != id))
return (0);
return((unsigned long) XEN_GETDOMAININFO_MAX_PAGES(dominfo) * 4);
return((unsigned long) XEN_GETDOMAININFO_MAX_PAGES(dominfo) * kb_per_pages);
}
#ifndef PROXY