mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
* src/xen_internal.c: fix for system with page size != 4k
Daniel
This commit is contained in:
parent
cc3697f722
commit
2c32196a2f
@ -1,3 +1,7 @@
|
|||||||
|
Fri Sep 29 17:16:40 CEST 2006 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
|
* src/xen_internal.c: fix for system with page size != 4k
|
||||||
|
|
||||||
Fri Sep 29 13:05:12 CEST 2006 Daniel Veillard <veillard@redhat.com>
|
Fri Sep 29 13:05:12 CEST 2006 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
* docs/bugs.html docs/libvir.html: added pointers on how to report
|
* docs/bugs.html docs/libvir.html: added pointers on how to report
|
||||||
|
@ -1489,6 +1489,13 @@ xenHypervisorGetDomInfo(virConnectPtr conn, int id, virDomainInfoPtr info)
|
|||||||
{
|
{
|
||||||
xen_getdomaininfo dominfo;
|
xen_getdomaininfo dominfo;
|
||||||
int ret;
|
int ret;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
if ((conn == NULL) || (conn->handle < 0) || (info == NULL))
|
if ((conn == NULL) || (conn->handle < 0) || (info == NULL))
|
||||||
return (-1);
|
return (-1);
|
||||||
@ -1527,8 +1534,8 @@ xenHypervisorGetDomInfo(virConnectPtr conn, int id, virDomainInfoPtr info)
|
|||||||
* kilobytes from page counts
|
* kilobytes from page counts
|
||||||
*/
|
*/
|
||||||
info->cpuTime = XEN_GETDOMAININFO_CPUTIME(dominfo);
|
info->cpuTime = XEN_GETDOMAININFO_CPUTIME(dominfo);
|
||||||
info->memory = XEN_GETDOMAININFO_TOT_PAGES(dominfo) * 4;
|
info->memory = XEN_GETDOMAININFO_TOT_PAGES(dominfo) * kb_per_pages;
|
||||||
info->maxMem = XEN_GETDOMAININFO_MAX_PAGES(dominfo) * 4;
|
info->maxMem = XEN_GETDOMAININFO_MAX_PAGES(dominfo) * kb_per_pages;
|
||||||
info->nrVirtCpu = XEN_GETDOMAININFO_CPUCOUNT(dominfo);
|
info->nrVirtCpu = XEN_GETDOMAININFO_CPUCOUNT(dominfo);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user