mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
bhyve: implement node information reporting
- Implement nodeGetCPUStats using nodeGetCPUStats() - Implement nodeGetMemoryStats using nodeGetMemoryStats()
This commit is contained in:
parent
66e3a3e914
commit
8ca5f46c59
@ -48,6 +48,7 @@
|
|||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "cpu/cpu.h"
|
#include "cpu/cpu.h"
|
||||||
#include "viraccessapicheck.h"
|
#include "viraccessapicheck.h"
|
||||||
|
#include "nodeinfo.h"
|
||||||
|
|
||||||
#include "bhyve_driver.h"
|
#include "bhyve_driver.h"
|
||||||
#include "bhyve_process.h"
|
#include "bhyve_process.h"
|
||||||
@ -496,6 +497,32 @@ cleanup:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
bhyveNodeGetCPUStats(virConnectPtr conn,
|
||||||
|
int cpuNum,
|
||||||
|
virNodeCPUStatsPtr params,
|
||||||
|
int *nparams,
|
||||||
|
unsigned int flags)
|
||||||
|
{
|
||||||
|
if (virNodeGetCPUStatsEnsureACL(conn) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return nodeGetCPUStats(cpuNum, params, nparams, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
bhyveNodeGetMemoryStats(virConnectPtr conn,
|
||||||
|
int cellNum,
|
||||||
|
virNodeMemoryStatsPtr params,
|
||||||
|
int *nparams,
|
||||||
|
unsigned int flags)
|
||||||
|
{
|
||||||
|
if (virNodeGetMemoryStatsEnsureACL(conn) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return nodeGetMemoryStats(cellNum, params, nparams, flags);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bhyveStateCleanup(void)
|
bhyveStateCleanup(void)
|
||||||
{
|
{
|
||||||
@ -594,6 +621,8 @@ static virDriver bhyveDriver = {
|
|||||||
.domainLookupByName = bhyveDomainLookupByName, /* 1.2.2 */
|
.domainLookupByName = bhyveDomainLookupByName, /* 1.2.2 */
|
||||||
.domainDefineXML = bhyveDomainDefineXML, /* 1.2.2 */
|
.domainDefineXML = bhyveDomainDefineXML, /* 1.2.2 */
|
||||||
.domainGetXMLDesc = bhyveDomainGetXMLDesc, /* 1.2.2 */
|
.domainGetXMLDesc = bhyveDomainGetXMLDesc, /* 1.2.2 */
|
||||||
|
.nodeGetCPUStats = bhyveNodeGetCPUStats, /* 1.2.2 */
|
||||||
|
.nodeGetMemoryStats = bhyveNodeGetMemoryStats, /* 1.2.2 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user