Skip to content

Commit 2e4a89d

Browse files
anirudhrbpraveen-pk
authored andcommitted
ch_driver: implement nodeGetMemoryStats
Implement nodeGetMemoryStats function for the Cloud Hypervisor driver similar to how it is implemented for other drivers. Signed-off-by: Anirudh Rayabharam <anrayabh@linux.microsoft.com>
1 parent bd2b556 commit 2e4a89d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/ch/ch_driver.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "vircommand.h"
3737
#include "virerror.h"
3838
#include "virfile.h"
39+
#include "virhostmem.h"
3940
#include "virlog.h"
4041
#include "virnetdevtap.h"
4142
#include "virobject.h"
@@ -2039,6 +2040,19 @@ chDomainInterfaceAddresses(virDomainPtr dom,
20392040
return ret;
20402041
}
20412042

2043+
static int
2044+
chNodeGetMemoryStats(virConnectPtr conn,
2045+
int cellNum,
2046+
virNodeMemoryStatsPtr params,
2047+
int *nparams,
2048+
unsigned int flags)
2049+
{
2050+
if (virNodeGetMemoryStatsEnsureACL(conn) < 0)
2051+
return -1;
2052+
2053+
return virHostMemGetStats(cellNum, params, nparams, flags);
2054+
}
2055+
20422056

20432057
/* Function Tables */
20442058
static virHypervisorDriver chHypervisorDriver = {
@@ -2093,6 +2107,7 @@ static virHypervisorDriver chHypervisorDriver = {
20932107
.domainSetAutostart = chDomainSetAutostart, /* 6.7.0 */
20942108
.domainSetVcpus = chDomainSetVcpus, /* 6.7.0 */
20952109
.domainInterfaceAddresses = chDomainInterfaceAddresses, /* 6.7.0 */
2110+
.nodeGetMemoryStats = chNodeGetMemoryStats, /* 6.7.0 */
20962111
};
20972112

20982113
static virConnectDriver chConnectDriver = {

0 commit comments

Comments
 (0)