mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-30 16:35:24 +00:00
vz: implement API calls of nodeGetxxx family
The following functions were implemented: vzNodeGetCPUStats, vzNodeGetMemoryStats, vzNodeGetCellsFreeMemory and vzNodeGetFreeMemory. Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
This commit is contained in:
parent
e16dd5f2d2
commit
4ff36e742b
@ -1350,6 +1350,44 @@ static int vzConnectGetMaxVcpus(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
vzNodeGetCPUStats(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
int cpuNum,
|
||||
virNodeCPUStatsPtr params,
|
||||
int *nparams,
|
||||
unsigned int flags)
|
||||
{
|
||||
return nodeGetCPUStats(cpuNum, params, nparams, flags);
|
||||
}
|
||||
|
||||
static int
|
||||
vzNodeGetMemoryStats(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
int cellNum,
|
||||
virNodeMemoryStatsPtr params,
|
||||
int *nparams,
|
||||
unsigned int flags)
|
||||
{
|
||||
return nodeGetMemoryStats(NULL, cellNum, params, nparams, flags);
|
||||
}
|
||||
|
||||
static int
|
||||
vzNodeGetCellsFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
unsigned long long *freeMems,
|
||||
int startCell,
|
||||
int maxCells)
|
||||
{
|
||||
return nodeGetCellsFreeMemory(freeMems, startCell, maxCells);
|
||||
}
|
||||
|
||||
static unsigned long long
|
||||
vzNodeGetFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED)
|
||||
{
|
||||
unsigned long long freeMem;
|
||||
if (nodeGetMemory(NULL, &freeMem) < 0)
|
||||
return 0;
|
||||
return freeMem;
|
||||
}
|
||||
|
||||
static virHypervisorDriver vzDriver = {
|
||||
.name = "vz",
|
||||
.connectOpen = vzConnectOpen, /* 0.10.0 */
|
||||
@ -1358,6 +1396,10 @@ static virHypervisorDriver vzDriver = {
|
||||
.connectGetHostname = vzConnectGetHostname, /* 0.10.0 */
|
||||
.connectGetMaxVcpus = vzConnectGetMaxVcpus, /* 1.2.21 */
|
||||
.nodeGetInfo = vzNodeGetInfo, /* 0.10.0 */
|
||||
.nodeGetCPUStats = vzNodeGetCPUStats, /* 1.2.21 */
|
||||
.nodeGetMemoryStats = vzNodeGetMemoryStats, /* 1.2.21 */
|
||||
.nodeGetCellsFreeMemory = vzNodeGetCellsFreeMemory, /* 1.2.21 */
|
||||
.nodeGetFreeMemory = vzNodeGetFreeMemory, /* 1.2.21 */
|
||||
.connectGetCapabilities = vzConnectGetCapabilities, /* 0.10.0 */
|
||||
.connectBaselineCPU = vzConnectBaselineCPU, /* 1.2.6 */
|
||||
.connectListDomains = vzConnectListDomains, /* 0.10.0 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user