提交 5533a01a 编写于 作者: D Daniel Veillard

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

  was missing
Daniel
上级 321c24bb
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
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册