From nobody Wed Oct 29 17:13:25 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=oracle.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525451943813405.31220144276006; Fri, 4 May 2018 09:39:03 -0700 (PDT) Received: from localhost ([::1]:35376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEdjW-0001pb-Pu for importer@patchew.org; Fri, 04 May 2018 12:38:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEdbz-0004JH-HP for qemu-devel@nongnu.org; Fri, 04 May 2018 12:31:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fEdbw-0007tU-C2 for qemu-devel@nongnu.org; Fri, 04 May 2018 12:31:11 -0400 Received: from hqdc-proxy-mwg11-o.oracle.com ([148.87.23.14]:58638 helo=jhdev.us.oracle.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEdbw-0007sO-6C for qemu-devel@nongnu.org; Fri, 04 May 2018 12:31:08 -0400 Received: by jhdev.us.oracle.com (Postfix, from userid 1001) id 5C33A419C6D47; Fri, 4 May 2018 09:31:02 -0700 (PDT) From: Jonathan Helman To: mst@redhat.com Date: Fri, 4 May 2018 09:30:45 -0700 Message-Id: <1525451445-5131-1-git-send-email-jonathan.helman@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 148.87.23.14 Subject: [Qemu-devel] [PATCH] virtio-balloon: fix internal stat name array to match Linux kernel X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: virtio-dev@lists.oasis-open.org, Jonathan Helman , Thomas Tai , Rob Gardner , qemu-devel@nongnu.org, jasowang@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The Linux kernel commit b40000325044 ("virtio_balloon: add array of stat names") defines an array of stat name strings for consumers of the virtio interface to use via the virtio_balloon.h header file, rather than requiring each consumer to define its own. But at present, the stat names defined in this array by the Linux kernel do not match up with those defined internally by QEMU. This patch fixes this inconsistency by changing the QEMU stat names to match those defined by the Linux kernel. Signed-off-by: Jonathan Helman Cc: Rob Gardner Cc: Thomas Tai --- docs/virtio-balloon-stats.txt | 4 ++-- hw/virtio/virtio-balloon.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/virtio-balloon-stats.txt b/docs/virtio-balloon-stats.txt index 9985e1d..7c69fdb 100644 --- a/docs/virtio-balloon-stats.txt +++ b/docs/virtio-balloon-stats.txt @@ -34,8 +34,8 @@ which will return a dictionary containing: - stat-total-memory - stat-available-memory - stat-disk-caches - - stat-htlb-pgalloc - - stat-htlb-pgfail + - stat-hugetlb-allocations + - stat-hugetlb-failures =20 o A key named last-update, which contains the last stats update timestamp in seconds. Since this timestamp is generated by the host, diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 1f7a87f..8421d9f 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -52,8 +52,8 @@ static const char *balloon_stat_names[] =3D { [VIRTIO_BALLOON_S_MEMTOT] =3D "stat-total-memory", [VIRTIO_BALLOON_S_AVAIL] =3D "stat-available-memory", [VIRTIO_BALLOON_S_CACHES] =3D "stat-disk-caches", - [VIRTIO_BALLOON_S_HTLB_PGALLOC] =3D "stat-htlb-pgalloc", - [VIRTIO_BALLOON_S_HTLB_PGFAIL] =3D "stat-htlb-pgfail", + [VIRTIO_BALLOON_S_HTLB_PGALLOC] =3D "stat-hugetlb-allocations", + [VIRTIO_BALLOON_S_HTLB_PGFAIL] =3D "stat-hugetlb-failures", [VIRTIO_BALLOON_S_NR] =3D NULL }; =20 --=20 1.8.3.1 Based-on: <1524799751-151698-5-git-send-email-mst@redhat.com> ([PULL 4/4] virtio-balloon: add hugetlb page allocation counts)