From nobody Thu Nov 21 12:58:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1731700161653577.3814705573033; Fri, 15 Nov 2024 11:49:21 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 836261A57; Fri, 15 Nov 2024 14:49:20 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 8DB271A56; Fri, 15 Nov 2024 14:49:05 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 4A24813A6; Fri, 15 Nov 2024 14:49:02 -0500 (EST) Received: from mail-oa1-f52.google.com (mail-oa1-f52.google.com [209.85.160.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 7367E1A38 for ; Fri, 15 Nov 2024 14:49:01 -0500 (EST) Received: by mail-oa1-f52.google.com with SMTP id 586e51a60fabf-2962feec93bso651350fac.1 for ; Fri, 15 Nov 2024 11:49:01 -0800 (PST) Received: from home.. ([2603:8081:c640:1::1008]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29651852c3dsm45409fac.11.2024.11.15.11.48.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 11:48:59 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731700140; x=1732304940; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+cuqDzkmKzOMK5g074vYNKq1OnK6h4tXeJkWRxzinAE=; b=O1O2Jb/T6Xzpv/6ApAYLHt2UARMK7ZZA+wWW9mrr454IV3k+iPDoicu4fk1wVKeNyz mobe6sY9uTzgFPJaVIWooY7awqD9coEAJvKdJAGo/GCd8uL16DOgva5y3ggl/NL0Gor8 Yukv0F1nOQOO6kXx8g9Q4quLhDYEKr7Q/3TZp5gpoQuVX2qwJYDbGKW3SZgAxTaBRRjt 1lgOBf8kBbCGqnUPxyi/ru7nTnFgpqWtRc1AKPs4k318WUT3uA9BfRhXp78x0IJBBWiT 5bmkhuocQaqXCOvLFAjEc6atPkkMX5WSIGJ951My3MIP8PwO8846qJ0hR/6jSURZT7/j 33HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731700140; x=1732304940; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+cuqDzkmKzOMK5g074vYNKq1OnK6h4tXeJkWRxzinAE=; b=PB4DXChGIA9yFC4XPPFh4M5ko3H5PpPQ1emYwMU6HOUlijkyjp5AppVCgpZIE3BZG7 FCatf/++81zkFowL/aHPLkBHTfJdYLw+ATtyUEX2lKPmgSUpaNlli6a+w3BI/ZNV5BBF 4zQXLU3SRb10kzWZPdCmnuQ2iDm4bQUlasor3PEA+PqJmqzNRU9VgKBwexZf+a50OD9j +2VGBlUBzNM53CPMskLafWk6E1MeMLSFnTKgbASKg7V36ueDT1kTQcc8lnn9RX5mUaGl kGPf1wordea2SvGS+5kBZ21P2mxu3sWIzi02EEgqr9HOtJuWXGO9N9ddPtc1JeQOs3eB VA9Q== X-Gm-Message-State: AOJu0YzW/E73nT9df3iky3Kli+eJb9eXQ5nQfkqaHzoT/6p78W/oXhJY l+qOtZ4xDWvdxfU4Zc3KRIzbzCwqtDuK+8990SpQHXJevPVUFLb/Fdz6bg== X-Google-Smtp-Source: AGHT+IELSJChhxLKd27lZVs/RdD3m2UE0L8r5Bxr54kdXnMYDsetD4xIRPfvCcgwRXczn4MrGamAcw== X-Received: by 2002:a05:6870:be95:b0:288:6220:fe0b with SMTP id 586e51a60fabf-2962dc72d5emr3974234fac.7.1731700140037; Fri, 15 Nov 2024 11:49:00 -0800 (PST) From: Praveen K Paladugu To: devel@lists.libvirt.org Subject: [PATCH] ch: enable virNodeGetMemoryStats API Date: Fri, 15 Nov 2024 13:48:58 -0600 Message-ID: <20241115194858.30514-1-praveenkpaladugu@gmail.com> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: NHEVPS2BE4WXEFDMNTLO4W4LVDIRN62E X-Message-ID-Hash: NHEVPS2BE4WXEFDMNTLO4W4LVDIRN62E X-MailFrom: praveenkpaladugu@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: liuwe@microsoft.com X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1731700162204116600 Content-Type: text/plain; charset="utf-8" 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 --- src/ch/ch_driver.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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" =20 #define VIR_FROM_THIS VIR_FROM_CH =20 @@ -2209,6 +2210,19 @@ chDomainSetNumaParameters(virDomainPtr dom, return ret; } =20 +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 =3D { .name =3D "CH", @@ -2266,6 +2280,7 @@ static virHypervisorDriver chHypervisorDriver =3D { .domainHasManagedSaveImage =3D chDomainHasManagedSaveImage, /* 10.2.= 0 */ .domainRestore =3D chDomainRestore, /* 10.2.0 */ .domainRestoreFlags =3D chDomainRestoreFlags, /* 10.2.0 */ + .nodeGetMemoryStats =3D chNodeGetMemoryStats, /* 10.10.0 */ }; =20 static virConnectDriver chConnectDriver =3D { --=20 2.47.0