From: Praveen K Paladugu Date: Fri, 15 Nov 2024 19:48:58 +0000 (-0600) Subject: ch: enable virNodeGetMemoryStats API X-Git-Tag: v10.10.0-rc1~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed1cef6264d50adeae12973abdd2ee102bceefb1;p=thirdparty%2Flibvirt.git ch: enable virNodeGetMemoryStats API Enable virNodeGetMemoryStats API to return the stats of host memory. Signed-off-by: Praveen K Paladugu Signed-off-by: Praveen K Paladugu Reviewed-by: Michal Privoznik --- diff --git a/src/ch/ch_driver.c b/src/ch/ch_driver.c index 17ae488a02..34f3a495fc 100644 --- a/src/ch/ch_driver.c +++ b/src/ch/ch_driver.c @@ -40,6 +40,7 @@ #include "virutil.h" #include "viruuid.h" #include "virnuma.h" +#include "virhostmem.h" #define VIR_FROM_THIS VIR_FROM_CH @@ -2209,6 +2210,19 @@ chDomainSetNumaParameters(virDomainPtr dom, return ret; } +static int +chNodeGetMemoryStats(virConnectPtr conn, + int cellNum, + virNodeMemoryStatsPtr params, + int *nparams, + unsigned int flags) +{ + if (virNodeGetMemoryStatsEnsureACL(conn) < 0) + return -1; + + return virHostMemGetStats(cellNum, params, nparams, flags); +} + /* Function Tables */ static virHypervisorDriver chHypervisorDriver = { .name = "CH", @@ -2266,6 +2280,7 @@ static virHypervisorDriver chHypervisorDriver = { .domainHasManagedSaveImage = chDomainHasManagedSaveImage, /* 10.2.0 */ .domainRestore = chDomainRestore, /* 10.2.0 */ .domainRestoreFlags = chDomainRestoreFlags, /* 10.2.0 */ + .nodeGetMemoryStats = chNodeGetMemoryStats, /* 10.10.0 */ }; static virConnectDriver chConnectDriver = {