nodeinfo: rename all memory APIs to have a virHostMem prefix

In preparation for moving all the memory related APIs out of
the nodeinfo file, give them a virHostMem name prefix.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2016-04-13 18:16:16 +01:00
parent bfb412a32e
commit dcfe37e682
12 changed files with 108 additions and 107 deletions

View File

@ -1175,7 +1175,7 @@ bhyveNodeGetMemoryStats(virConnectPtr conn,
if (virNodeGetMemoryStatsEnsureACL(conn) < 0)
return -1;
return nodeGetMemoryStats(cellNum, params, nparams, flags);
return virHostMemGetStats(cellNum, params, nparams, flags);
}
static int
@ -1346,7 +1346,7 @@ bhyveNodeGetFreeMemory(virConnectPtr conn)
if (virNodeGetFreeMemoryEnsureACL(conn) < 0)
return 0;
if (nodeGetMemory(NULL, &freeMem) < 0)
if (virHostMemGetInfo(NULL, &freeMem) < 0)
return 0;
return freeMem;
@ -1373,7 +1373,7 @@ bhyveNodeGetMemoryParameters(virConnectPtr conn,
if (virNodeGetMemoryParametersEnsureACL(conn) < 0)
return -1;
return nodeGetMemoryParameters(params, nparams, flags);
return virHostMemGetParameters(params, nparams, flags);
}
static int
@ -1385,7 +1385,7 @@ bhyveNodeSetMemoryParameters(virConnectPtr conn,
if (virNodeSetMemoryParametersEnsureACL(conn) < 0)
return -1;
return nodeSetMemoryParameters(params, nparams, flags);
return virHostMemSetParameters(params, nparams, flags);
}
static char *

View File

@ -1059,21 +1059,21 @@ virLogManagerNew;
# nodeinfo.h
nodeAllocPages;
nodeCapsInitNUMA;
nodeGetCellsFreeMemory;
nodeGetCPUCount;
nodeGetCPUMap;
nodeGetCPUStats;
nodeGetFreePages;
nodeGetInfo;
nodeGetMemory;
nodeGetMemoryParameters;
nodeGetMemoryStats;
nodeGetOnlineCPUBitmap;
nodeGetPresentCPUBitmap;
nodeGetThreadsPerSubcore;
nodeSetMemoryParameters;
virHostMemAllocPages;
virHostMemGetCellsFree;
virHostMemGetFreePages;
virHostMemGetInfo;
virHostMemGetParameters;
virHostMemGetStats;
virHostMemSetParameters;
# secret/secret_util.h

View File

@ -5246,7 +5246,7 @@ lxcNodeGetMemoryStats(virConnectPtr conn,
if (virNodeGetMemoryStatsEnsureACL(conn) < 0)
return -1;
return nodeGetMemoryStats(cellNum, params, nparams, flags);
return virHostMemGetStats(cellNum, params, nparams, flags);
}
@ -5259,7 +5259,7 @@ lxcNodeGetCellsFreeMemory(virConnectPtr conn,
if (virNodeGetCellsFreeMemoryEnsureACL(conn) < 0)
return -1;
return nodeGetCellsFreeMemory(freeMems, startCell, maxCells);
return virHostMemGetCellsFree(freeMems, startCell, maxCells);
}
@ -5271,7 +5271,7 @@ lxcNodeGetFreeMemory(virConnectPtr conn)
if (virNodeGetFreeMemoryEnsureACL(conn) < 0)
return 0;
if (nodeGetMemory(NULL, &freeMem) < 0)
if (virHostMemGetInfo(NULL, &freeMem) < 0)
return 0;
return freeMem;
@ -5287,7 +5287,7 @@ lxcNodeGetMemoryParameters(virConnectPtr conn,
if (virNodeGetMemoryParametersEnsureACL(conn) < 0)
return -1;
return nodeGetMemoryParameters(params, nparams, flags);
return virHostMemGetParameters(params, nparams, flags);
}
@ -5300,7 +5300,7 @@ lxcNodeSetMemoryParameters(virConnectPtr conn,
if (virNodeSetMemoryParametersEnsureACL(conn) < 0)
return -1;
return nodeSetMemoryParameters(params, nparams, flags);
return virHostMemSetParameters(params, nparams, flags);
}
@ -5464,7 +5464,7 @@ lxcNodeGetFreePages(virConnectPtr conn,
if (virNodeGetFreePagesEnsureACL(conn) < 0)
return -1;
return nodeGetFreePages(npages, pages, startCell, cellCount, counts);
return virHostMemGetFreePages(npages, pages, startCell, cellCount, counts);
}
@ -5484,8 +5484,8 @@ lxcNodeAllocPages(virConnectPtr conn,
if (virNodeAllocPagesEnsureACL(conn) < 0)
return -1;
return nodeAllocPages(npages, pageSizes, pageCounts,
startCell, cellCount, add);
return virHostMemAllocPages(npages, pageSizes, pageCounts,
startCell, cellCount, add);
}

View File

@ -187,7 +187,7 @@ freebsdNodeGetCPUStats(int cpuNum,
}
static int
freebsdNodeGetMemoryStats(virNodeMemoryStatsPtr params,
virHostMemGetStatsFreeBSD(virNodeMemoryStatsPtr params,
int *nparams)
{
size_t i, j = 0;
@ -960,7 +960,7 @@ linuxNodeGetCPUStats(FILE *procstat,
}
static int
linuxNodeGetMemoryStats(FILE *meminfo,
virHostMemGetStatsLinux(FILE *meminfo,
int cellNum,
virNodeMemoryStatsPtr params,
int *nparams)
@ -1247,7 +1247,7 @@ nodeGetInfo(virNodeInfoPtr nodeinfo)
if (virStrcpyStatic(nodeinfo->model, virArchToString(hostarch)) == NULL)
return -1;
if (nodeGetMemory(&memorybytes, NULL) < 0)
if (virHostMemGetInfo(&memorybytes, NULL) < 0)
return -1;
nodeinfo->memory = memorybytes / 1024;
@ -1292,7 +1292,7 @@ nodeGetCPUStats(int cpuNum ATTRIBUTE_UNUSED,
}
int
nodeGetMemoryStats(int cellNum ATTRIBUTE_UNUSED,
virHostMemGetStats(int cellNum ATTRIBUTE_UNUSED,
virNodeMemoryStatsPtr params ATTRIBUTE_UNUSED,
int *nparams ATTRIBUTE_UNUSED,
unsigned int flags)
@ -1333,14 +1333,14 @@ nodeGetMemoryStats(int cellNum ATTRIBUTE_UNUSED,
VIR_FREE(meminfo_path);
return -1;
}
ret = linuxNodeGetMemoryStats(meminfo, cellNum, params, nparams);
ret = virHostMemGetStatsLinux(meminfo, cellNum, params, nparams);
VIR_FORCE_FCLOSE(meminfo);
VIR_FREE(meminfo_path);
return ret;
}
#elif defined(__FreeBSD__)
return freebsdNodeGetMemoryStats(params, nparams);
return virHostMemGetStatsFreeBSD(params, nparams);
#else
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("node memory stats not implemented on this platform"));
@ -1491,7 +1491,7 @@ nodeGetOnlineCPUBitmap(void)
#ifdef __linux__
static int
nodeSetMemoryParameterValue(virTypedParameterPtr param)
virHostMemSetParameterValue(virTypedParameterPtr param)
{
char *path = NULL;
char *strval = NULL;
@ -1525,8 +1525,8 @@ nodeSetMemoryParameterValue(virTypedParameterPtr param)
}
static bool
nodeMemoryParametersIsAllSupported(virTypedParameterPtr params,
int nparams)
virHostMemParametersAreAllSupported(virTypedParameterPtr params,
int nparams)
{
char *path = NULL;
size_t i;
@ -1557,7 +1557,7 @@ nodeMemoryParametersIsAllSupported(virTypedParameterPtr params,
#endif
int
nodeSetMemoryParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
virHostMemSetParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
int nparams ATTRIBUTE_UNUSED,
unsigned int flags)
{
@ -1577,11 +1577,11 @@ nodeSetMemoryParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
NULL) < 0)
return -1;
if (!nodeMemoryParametersIsAllSupported(params, nparams))
if (!virHostMemParametersAreAllSupported(params, nparams))
return -1;
for (i = 0; i < nparams; i++) {
rc = nodeSetMemoryParameterValue(&params[i]);
rc = virHostMemSetParameterValue(&params[i]);
if (rc < 0)
return -1;
@ -1598,7 +1598,7 @@ nodeSetMemoryParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
#ifdef __linux__
static int
nodeGetMemoryParameterValue(const char *field,
virHostMemGetParameterValue(const char *field,
void *value)
{
char *path = NULL;
@ -1649,7 +1649,7 @@ nodeGetMemoryParameterValue(const char *field,
#define NODE_MEMORY_PARAMETERS_NUM 8
int
nodeGetMemoryParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
virHostMemGetParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
int *nparams ATTRIBUTE_UNUSED,
unsigned int flags)
{
@ -1677,7 +1677,7 @@ nodeGetMemoryParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
switch (i) {
case 0:
ret = nodeGetMemoryParameterValue("pages_to_scan", &pages_to_scan);
ret = virHostMemGetParameterValue("pages_to_scan", &pages_to_scan);
if (ret == -2)
continue;
else if (ret == -1)
@ -1690,7 +1690,7 @@ nodeGetMemoryParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
break;
case 1:
ret = nodeGetMemoryParameterValue("sleep_millisecs", &sleep_millisecs);
ret = virHostMemGetParameterValue("sleep_millisecs", &sleep_millisecs);
if (ret == -2)
continue;
else if (ret == -1)
@ -1703,7 +1703,7 @@ nodeGetMemoryParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
break;
case 2:
ret = nodeGetMemoryParameterValue("pages_shared", &pages_shared);
ret = virHostMemGetParameterValue("pages_shared", &pages_shared);
if (ret == -2)
continue;
else if (ret == -1)
@ -1716,7 +1716,7 @@ nodeGetMemoryParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
break;
case 3:
ret = nodeGetMemoryParameterValue("pages_sharing", &pages_sharing);
ret = virHostMemGetParameterValue("pages_sharing", &pages_sharing);
if (ret == -2)
continue;
else if (ret == -1)
@ -1729,7 +1729,7 @@ nodeGetMemoryParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
break;
case 4:
ret = nodeGetMemoryParameterValue("pages_unshared", &pages_unshared);
ret = virHostMemGetParameterValue("pages_unshared", &pages_unshared);
if (ret == -2)
continue;
else if (ret == -1)
@ -1742,7 +1742,7 @@ nodeGetMemoryParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
break;
case 5:
ret = nodeGetMemoryParameterValue("pages_volatile", &pages_volatile);
ret = virHostMemGetParameterValue("pages_volatile", &pages_volatile);
if (ret == -2)
continue;
else if (ret == -1)
@ -1755,7 +1755,7 @@ nodeGetMemoryParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
break;
case 6:
ret = nodeGetMemoryParameterValue("full_scans", &full_scans);
ret = virHostMemGetParameterValue("full_scans", &full_scans);
if (ret == -2)
continue;
else if (ret == -1)
@ -1768,7 +1768,7 @@ nodeGetMemoryParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
break;
case 7:
ret = nodeGetMemoryParameterValue("merge_across_nodes", &merge_across_nodes);
ret = virHostMemGetParameterValue("merge_across_nodes", &merge_across_nodes);
if (ret == -2)
continue;
else if (ret == -1)
@ -1886,7 +1886,7 @@ nodeCapsInitNUMAFake(const char *cpupath ATTRIBUTE_UNUSED,
}
static int
nodeGetCellsFreeMemoryFake(unsigned long long *freeMems,
virHostMemGetCellsFreeFake(unsigned long long *freeMems,
int startCell,
int maxCells ATTRIBUTE_UNUSED)
{
@ -1911,8 +1911,8 @@ nodeGetCellsFreeMemoryFake(unsigned long long *freeMems,
}
static int
nodeGetMemoryFake(unsigned long long *mem,
unsigned long long *freeMem)
virHostMemGetInfoFake(unsigned long long *mem,
unsigned long long *freeMem)
{
int ret = -1;
@ -2140,7 +2140,7 @@ nodeCapsInitNUMA(virCapsPtr caps)
int
nodeGetCellsFreeMemory(unsigned long long *freeMems,
virHostMemGetCellsFree(unsigned long long *freeMems,
int startCell,
int maxCells)
{
@ -2150,7 +2150,7 @@ nodeGetCellsFreeMemory(unsigned long long *freeMems,
int maxCell;
if (!virNumaIsAvailable())
return nodeGetCellsFreeMemoryFake(freeMems,
return virHostMemGetCellsFreeFake(freeMems,
startCell, maxCells);
if ((maxCell = virNumaGetMaxNode()) < 0)
@ -2178,8 +2178,8 @@ nodeGetCellsFreeMemory(unsigned long long *freeMems,
}
int
nodeGetMemory(unsigned long long *mem,
unsigned long long *freeMem)
virHostMemGetInfo(unsigned long long *mem,
unsigned long long *freeMem)
{
int max_node;
int n;
@ -2191,7 +2191,7 @@ nodeGetMemory(unsigned long long *mem,
*freeMem = 0;
if (!virNumaIsAvailable())
return nodeGetMemoryFake(mem, freeMem);
return virHostMemGetInfoFake(mem, freeMem);
if ((max_node = virNumaGetMaxNode()) < 0)
return -1;
@ -2216,11 +2216,11 @@ nodeGetMemory(unsigned long long *mem,
}
int
nodeGetFreePages(unsigned int npages,
unsigned int *pages,
int startCell,
unsigned int cellCount,
unsigned long long *counts)
virHostMemGetFreePages(unsigned int npages,
unsigned int *pages,
int startCell,
unsigned int cellCount,
unsigned long long *counts)
{
int ret = -1;
int cell, lastCell;
@ -2262,12 +2262,12 @@ nodeGetFreePages(unsigned int npages,
}
int
nodeAllocPages(unsigned int npages,
unsigned int *pageSizes,
unsigned long long *pageCounts,
int startCell,
unsigned int cellCount,
bool add)
virHostMemAllocPages(unsigned int npages,
unsigned int *pageSizes,
unsigned long long *pageCounts,
int startCell,
unsigned int cellCount,
bool add)
{
int ret = -1;
int cell, lastCell;

View File

@ -33,26 +33,26 @@ int nodeGetCPUStats(int cpuNum,
virNodeCPUStatsPtr params,
int *nparams,
unsigned int flags);
int nodeGetMemoryStats(int cellNum,
int virHostMemGetStats(int cellNum,
virNodeMemoryStatsPtr params,
int *nparams,
unsigned int flags);
int nodeGetCellsFreeMemory(unsigned long long *freeMems,
int virHostMemGetCellsFree(unsigned long long *freeMems,
int startCell,
int maxCells);
int nodeGetMemory(unsigned long long *mem,
unsigned long long *freeMem);
int virHostMemGetInfo(unsigned long long *mem,
unsigned long long *freeMem);
virBitmapPtr nodeGetPresentCPUBitmap(void);
virBitmapPtr nodeGetOnlineCPUBitmap(void);
int nodeGetCPUCount(void);
int nodeGetThreadsPerSubcore(virArch arch);
int nodeGetMemoryParameters(virTypedParameterPtr params,
int virHostMemGetParameters(virTypedParameterPtr params,
int *nparams,
unsigned int flags);
int nodeSetMemoryParameters(virTypedParameterPtr params,
int virHostMemSetParameters(virTypedParameterPtr params,
int nparams,
unsigned int flags);
@ -60,16 +60,17 @@ int nodeGetCPUMap(unsigned char **cpumap,
unsigned int *online,
unsigned int flags);
int nodeGetFreePages(unsigned int npages,
unsigned int *pages,
int startCell,
unsigned int cellCount,
unsigned long long *counts);
int virHostMemGetFreePages(unsigned int npages,
unsigned int *pages,
int startCell,
unsigned int cellCount,
unsigned long long *counts);
int virHostMemAllocPages(unsigned int npages,
unsigned int *pageSizes,
unsigned long long *pageCounts,
int startCell,
unsigned int cellCount,
bool add);
int nodeAllocPages(unsigned int npages,
unsigned int *pageSizes,
unsigned long long *pageCounts,
int startCell,
unsigned int cellCount,
bool add);
#endif /* __VIR_NODEINFO_H__*/

View File

@ -2179,7 +2179,7 @@ openvzNodeGetMemoryStats(virConnectPtr conn ATTRIBUTE_UNUSED,
int *nparams,
unsigned int flags)
{
return nodeGetMemoryStats(cellNum, params, nparams, flags);
return virHostMemGetStats(cellNum, params, nparams, flags);
}
@ -2189,7 +2189,7 @@ openvzNodeGetCellsFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED,
int startCell,
int maxCells)
{
return nodeGetCellsFreeMemory(freeMems, startCell, maxCells);
return virHostMemGetCellsFree(freeMems, startCell, maxCells);
}
@ -2197,7 +2197,7 @@ static unsigned long long
openvzNodeGetFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED)
{
unsigned long long freeMem;
if (nodeGetMemory(NULL, &freeMem) < 0)
if (virHostMemGetInfo(NULL, &freeMem) < 0)
return 0;
return freeMem;
}

View File

@ -18109,7 +18109,7 @@ qemuNodeGetMemoryStats(virConnectPtr conn,
if (virNodeGetMemoryStatsEnsureACL(conn) < 0)
return -1;
return nodeGetMemoryStats(cellNum, params, nparams, flags);
return virHostMemGetStats(cellNum, params, nparams, flags);
}
@ -18122,7 +18122,7 @@ qemuNodeGetCellsFreeMemory(virConnectPtr conn,
if (virNodeGetCellsFreeMemoryEnsureACL(conn) < 0)
return -1;
return nodeGetCellsFreeMemory(freeMems, startCell, maxCells);
return virHostMemGetCellsFree(freeMems, startCell, maxCells);
}
@ -18134,7 +18134,7 @@ qemuNodeGetFreeMemory(virConnectPtr conn)
if (virNodeGetFreeMemoryEnsureACL(conn) < 0)
return 0;
if (nodeGetMemory(NULL, &freeMem) < 0)
if (virHostMemGetInfo(NULL, &freeMem) < 0)
return 0;
return freeMem;
@ -18150,7 +18150,7 @@ qemuNodeGetMemoryParameters(virConnectPtr conn,
if (virNodeGetMemoryParametersEnsureACL(conn) < 0)
return -1;
return nodeGetMemoryParameters(params, nparams, flags);
return virHostMemGetParameters(params, nparams, flags);
}
@ -18163,7 +18163,7 @@ qemuNodeSetMemoryParameters(virConnectPtr conn,
if (virNodeSetMemoryParametersEnsureACL(conn) < 0)
return -1;
return nodeSetMemoryParameters(params, nparams, flags);
return virHostMemSetParameters(params, nparams, flags);
}
@ -18434,7 +18434,7 @@ qemuNodeGetFreePages(virConnectPtr conn,
if (virNodeGetFreePagesEnsureACL(conn) < 0)
return -1;
return nodeGetFreePages(npages, pages, startCell, cellCount, counts);
return virHostMemGetFreePages(npages, pages, startCell, cellCount, counts);
}
@ -19337,8 +19337,8 @@ qemuNodeAllocPages(virConnectPtr conn,
if (virNodeAllocPagesEnsureACL(conn) < 0)
return -1;
return nodeAllocPages(npages, pageSizes, pageCounts,
startCell, cellCount, add);
return virHostMemAllocPages(npages, pageSizes, pageCounts,
startCell, cellCount, add);
}

View File

@ -2802,7 +2802,7 @@ umlNodeGetMemoryStats(virConnectPtr conn,
if (virNodeGetMemoryStatsEnsureACL(conn) < 0)
return -1;
return nodeGetMemoryStats(cellNum, params, nparams, flags);
return virHostMemGetStats(cellNum, params, nparams, flags);
}
@ -2815,7 +2815,7 @@ umlNodeGetCellsFreeMemory(virConnectPtr conn,
if (virNodeGetCellsFreeMemoryEnsureACL(conn) < 0)
return -1;
return nodeGetCellsFreeMemory(freeMems, startCell, maxCells);
return virHostMemGetCellsFree(freeMems, startCell, maxCells);
}
@ -2827,7 +2827,7 @@ umlNodeGetFreeMemory(virConnectPtr conn)
if (virNodeGetFreeMemoryEnsureACL(conn) < 0)
return 0;
if (nodeGetMemory(NULL, &freeMem) < 0)
if (virHostMemGetInfo(NULL, &freeMem) < 0)
return 0;
return freeMem;
@ -2843,7 +2843,7 @@ umlNodeGetMemoryParameters(virConnectPtr conn,
if (virNodeGetMemoryParametersEnsureACL(conn) < 0)
return -1;
return nodeGetMemoryParameters(params, nparams, flags);
return virHostMemGetParameters(params, nparams, flags);
}
@ -2856,7 +2856,7 @@ umlNodeSetMemoryParameters(virConnectPtr conn,
if (virNodeSetMemoryParametersEnsureACL(conn) < 0)
return -1;
return nodeSetMemoryParameters(params, nparams, flags);
return virHostMemSetParameters(params, nparams, flags);
}
@ -2900,7 +2900,7 @@ umlNodeGetFreePages(virConnectPtr conn,
if (virNodeGetFreePagesEnsureACL(conn) < 0)
return -1;
return nodeGetFreePages(npages, pages, startCell, cellCount, counts);
return virHostMemGetFreePages(npages, pages, startCell, cellCount, counts);
}
@ -2920,8 +2920,8 @@ umlNodeAllocPages(virConnectPtr conn,
if (virNodeAllocPagesEnsureACL(conn) < 0)
return -1;
return nodeAllocPages(npages, pageSizes, pageCounts,
startCell, cellCount, add);
return virHostMemAllocPages(npages, pageSizes, pageCounts,
startCell, cellCount, add);
}

View File

@ -659,7 +659,7 @@ virNumaGetPageInfo(int node,
/* TODO: come up with better algorithm that takes huge pages into
* account. The problem is huge pages cut off regular memory. */
if (node == -1) {
if (nodeGetMemory(&memsize, &memfree) < 0)
if (virHostMemGetInfo(&memsize, &memfree) < 0)
goto cleanup;
} else {
if (virNumaGetNodeMemory(node, &memsize, &memfree) < 0)

View File

@ -7536,14 +7536,14 @@ vboxNodeGetCellsFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED,
int startCell,
int maxCells)
{
return nodeGetCellsFreeMemory(freeMems, startCell, maxCells);
return virHostMemGetCellsFree(freeMems, startCell, maxCells);
}
static unsigned long long
vboxNodeGetFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED)
{
unsigned long long freeMem;
if (nodeGetMemory(NULL, &freeMem) < 0)
if (virHostMemGetInfo(NULL, &freeMem) < 0)
return 0;
return freeMem;
}
@ -7559,7 +7559,7 @@ vboxNodeGetFreePages(virConnectPtr conn ATTRIBUTE_UNUSED,
{
virCheckFlags(0, -1);
return nodeGetFreePages(npages, pages, startCell, cellCount, counts);
return virHostMemGetFreePages(npages, pages, startCell, cellCount, counts);
}
static int
@ -7575,8 +7575,8 @@ vboxNodeAllocPages(virConnectPtr conn ATTRIBUTE_UNUSED,
virCheckFlags(VIR_NODE_ALLOC_PAGES_SET, -1);
return nodeAllocPages(npages, pageSizes, pageCounts,
startCell, cellCount, add);
return virHostMemAllocPages(npages, pageSizes, pageCounts,
startCell, cellCount, add);
}
static int

View File

@ -1487,7 +1487,7 @@ vzNodeGetMemoryStats(virConnectPtr conn ATTRIBUTE_UNUSED,
int *nparams,
unsigned int flags)
{
return nodeGetMemoryStats(cellNum, params, nparams, flags);
return virHostMemGetStats(cellNum, params, nparams, flags);
}
static int
@ -1496,14 +1496,14 @@ vzNodeGetCellsFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED,
int startCell,
int maxCells)
{
return nodeGetCellsFreeMemory(freeMems, startCell, maxCells);
return virHostMemGetCellsFree(freeMems, startCell, maxCells);
}
static unsigned long long
vzNodeGetFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED)
{
unsigned long long freeMem;
if (nodeGetMemory(NULL, &freeMem) < 0)
if (virHostMemGetInfo(NULL, &freeMem) < 0)
return 0;
return freeMem;
}

View File

@ -2564,7 +2564,7 @@ xenUnifiedNodeGetMemoryParameters(virConnectPtr conn,
if (virNodeGetMemoryParametersEnsureACL(conn) < 0)
return -1;
return nodeGetMemoryParameters(params, nparams, flags);
return virHostMemGetParameters(params, nparams, flags);
}
@ -2577,7 +2577,7 @@ xenUnifiedNodeSetMemoryParameters(virConnectPtr conn,
if (virNodeSetMemoryParametersEnsureACL(conn) < 0)
return -1;
return nodeSetMemoryParameters(params, nparams, flags);
return virHostMemSetParameters(params, nparams, flags);
}