From nobody Mon Sep 14 04:51:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1788517531; cv=none; d=zohomail.com; s=zohoarc; b=MOqA+ADNuLnXub2BG0CU72VIFzITHlghUG3xMG0NugCp3PHmajBnzQ0hHQbuCJnOr9oaZK3C+zs5YLJQRA8rKLJnNqsoCNc32ROudlBIyHEbFFJoc2ClhECZF9CIGkPYs2XCbp2bBhoXN+AEWpQaeWFNbro3LCFT8SBIVHQQoqc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788517531; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=PGFYnL+V3+qWPTYTE+etDyCVGXe3Qw3o/lPSVV4cBRI=; b=lOTl2hG5qFF64l3iPdp0clkbmWPoq8qSy+lrI8qjV8m+9PgmRLzEdvg1/W5Ow73Q83mfL4LIcgWVI0Q16zjUFvAUQCcxLkJeRH3RcqVhjEipCKwufjZKX828pvuwzgYZLME+3dqdzvO2ByTILkKy5a4ZjGMwCm2z0WdYbHbdOPU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1788517531333641.1492450805907; Fri, 4 Sep 2026 03:25:31 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id D297D3F955; Fri, 4 Sep 2026 06:25:28 -0400 (EDT) Received: from [172.19.199.13] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id DF45F41949 for ; Fri, 4 Sep 2026 06:22:51 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 041733F303; Fri, 4 Sep 2026 06:22:27 -0400 (EDT) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 9FB8F3F2F8 for ; Fri, 4 Sep 2026 06:22:26 -0400 (EDT) Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2026 03:22:25 -0700 Received: from ubuntu.ger.corp.intel.com ([10.211.96.193]) by orviesa007.jf.intel.com with ESMTP; 04 Sep 2026 03:22:25 -0700 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1788517346; x=1820053346; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nb72gWBJEpHJrCZkUZeJGqRPO+Cctp37gWfhQLf9M4s=; b=XBk9b43h95aC/f/A2Y76LGXLmPL/mgyUmCmoQaWLdwgLEtM86OXg4M23 H+ZHadKE36sMAs3yPOg28j5bc/KWW8yys61EGu7Cvq92TZC5WGx61suXs 86c+ISWyJ5RqKFFG7Zkt25kTwhgEzZxRZbWph1o0Mgm7LfX4Gz0wgk084 lSOilYuS+apiap9kPV1vaUKNPaTEl4CDLCVFhvlJs/YWKj+9KWDFIJuTA TnEjO4exZdb+y0l27Of7fJyZJIfMQ3HHlpMjVFs0GDCmJjT/Up+8WxLGL W1jsA/0DlecsGASigPY5cjKC1K9pA+mjRcar/zyvT5RqwuzDWR99OAaNM Q==; X-CSE-ConnectionGUID: 5a4wUB1qR/yl39GcfeR8uQ== X-CSE-MsgGUID: 6kGuLEZGSSS1uvD0u58h/g== X-IronPort-AV: E=McAfee;i="6800,10657,11895"; a="88863624" X-IronPort-AV: E=Sophos;i="6.25,260,1779174000"; d="scan'208";a="88863624" X-CSE-ConnectionGUID: r64n8fbsRyaYiyg5xuT0NA== X-CSE-MsgGUID: ilsJp3YLQ1mGyTyNl80V5g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,260,1779174000"; d="scan'208";a="269990814" From: Jedrzej Wasiukiewicz To: devel@lists.libvirt.org Subject: [PATCH v2 1/2] qemu: fix resctrl monitor stats reporting the wrong group name Date: Fri, 4 Sep 2026 12:23:21 +0200 Message-ID: <20260904102322.583641-2-jedrzej.wasiukiewicz@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260904102322.583641-1-jedrzej.wasiukiewicz@intel.com> References: <20260904102322.583641-1-jedrzej.wasiukiewicz@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: EWROPKEIYJR2MVT54UTZGIR7HDD4NXDF X-Message-ID-Hash: EWROPKEIYJR2MVT54UTZGIR7HDD4NXDF X-MailFrom: jedrzej.wasiukiewicz@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: "Christopher M . Cantalupo" , Michal Privoznik X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1788517534336158500 Content-Type: text/plain; charset="utf-8" qemuDomainGetResctrlMonData filled the monitor's reported name from virResctrlMonitorGetID(), the bare id parsed from the domain XML (e.g. "vcpus_0-1"). That is a bug and a duplicate: the id is only a fragment of the real resctrl group name and vcpus are already reported with the vcpus attribute. The group actually lives at mon_groups/-. Add virResctrlMonitorGetName(), which returns the basename of the monitor's resctrl path. The stats name now maps 1:1 to the mon_group directory backing the monitor. Signed-off-by: Jedrzej Wasiukiewicz Reviewed-by: Christopher M. Cantalupo Reviewed-by: Michal Privoznik --- src/libvirt_private.syms | 1 + src/qemu/qemu_driver.c | 2 +- src/util/virresctrl.c | 10 ++++++++++ src/util/virresctrl.h | 3 +++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 81d0574676..798d2d28c8 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3397,6 +3397,7 @@ virResctrlMonitorAddPID; virResctrlMonitorCreate; virResctrlMonitorDeterminePath; virResctrlMonitorGetID; +virResctrlMonitorGetName; virResctrlMonitorGetStats; virResctrlMonitorNew; virResctrlMonitorRemove; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index cb144407c4..9abd4d5618 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17415,7 +17415,7 @@ qemuDomainGetResctrlMonData(virQEMUDriver *driver, * let this newly allocated memory buffer to be freed along wi= th * the free of 'res' */ res->vcpus =3D virBitmapFormat(domresmon->vcpus); - res->name =3D g_strdup(virResctrlMonitorGetID(monitor)); + res->name =3D virResctrlMonitorGetName(monitor); =20 if (virResctrlMonitorGetStats(monitor, (const char **)features, &res->stats, &res->nstats) < 0) diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index 66df44fb58..b3e5c34443 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -2587,6 +2587,16 @@ virResctrlMonitorGetID(virResctrlMonitor *monitor) } =20 =20 +char * +virResctrlMonitorGetName(virResctrlMonitor *monitor) +{ + if (!monitor->path) + return NULL; + + return g_path_get_basename(monitor->path); +} + + void virResctrlMonitorSetAlloc(virResctrlMonitor *monitor, virResctrlAlloc *alloc) diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h index 2818b6e8cc..c12b521621 100644 --- a/src/util/virresctrl.h +++ b/src/util/virresctrl.h @@ -233,6 +233,9 @@ virResctrlMonitorSetID(virResctrlMonitor *monitor, const char * virResctrlMonitorGetID(virResctrlMonitor *monitor); =20 +char * +virResctrlMonitorGetName(virResctrlMonitor *monitor); + void virResctrlMonitorSetAlloc(virResctrlMonitor *monitor, virResctrlAlloc *alloc); --=20 2.43.0 --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydz= ial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-31= 6 | Kapital zakladowy 200.000 PLN. Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu usta= wy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w trans= akcjach handlowych. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata= i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wi= adomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiek= olwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). If you are not the intended recipient= , please contact the sender and delete all copies; any review or distributi= on by others is strictly prohibited. From nobody Mon Sep 14 04:51:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1788517580; cv=none; d=zohomail.com; s=zohoarc; b=GbSFBUGl+t7jumDtaPb8NG7QQXx0xiWag0ckMlrbN2Suwn7aoFcjSMDj6A623j5EFnkt7/DKzDW+/n7fP0sPDvr7Twme0PesuB9lZq98MkwV+l/v588oC2BPJDjRo5wPM4i4/uV0VYRXnQc0TZzsDEAT53HdKdjPxzM4C7pIgC4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788517580; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=k6ECp/pE/E7AXfFsD6XJd1SY69gY/OGRWw4hqZrpQCc=; b=L8HNKmcKeYmD6iuuYUyEasABDFeZSdvnCKBXHTzz5IwSbA4XIec2O1cGDXXZmnj696aLjtdP0AMAaMUFhjPhnJE7yRKSzCDZ2TvGIAnQ2hSqGt/+KVqo7Ej+M6o2HmFq+LxmFd/biCNwnIs23aSmOGTpQRvBIS60JfdU7q4ePVE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1788517580496992.0189705977044; Fri, 4 Sep 2026 03:26:20 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 769093F933; Fri, 4 Sep 2026 06:26:19 -0400 (EDT) Received: from [172.19.199.13] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 082033FA60 for ; Fri, 4 Sep 2026 06:22:58 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 8C8B53F303; Fri, 4 Sep 2026 06:22:28 -0400 (EDT) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 38D3E3F316 for ; Fri, 4 Sep 2026 06:22:27 -0400 (EDT) Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2026 03:22:26 -0700 Received: from ubuntu.ger.corp.intel.com ([10.211.96.193]) by orviesa007.jf.intel.com with ESMTP; 04 Sep 2026 03:22:26 -0700 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1788517347; x=1820053347; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pMTz8xGOUMhDcypa7fC8BmUbbacc5OH8UNFqRnR/CKg=; b=RPXe7mWLMCOpY3Gw76B8yJNhod65aqBl9ft9zdOOZ130MoVAFBomOXE3 legtSaiqCYqKnj7Jxd+Qqizvfc5DMxC/x/NjKobVg8tV5tskWTwdqbb5/ 7J/edgOBeqKgu8JmzuaHSShr0V8cr2TB7/GCQYL5T3nC9bz8gL0XE/BUz bumgkVQWw57iImZgfqQXN2FmrrVmA12aNzjhBBDE1SZAWgT/Uquhk6W8m EqDJvSLZV6OTqRunmOdoG807+MLr4BCGcA74eRlGBsH52WxhToHM7k/7w yIph5yyyful3bl8+XDhIxJ0oVTVVuWmg6d5pidOvmMLtCqviydm1jMD6D g==; X-CSE-ConnectionGUID: bnurALbLTm+4vwSKymBHRg== X-CSE-MsgGUID: BZifhU6AR3KF9JxCFFOV2A== X-IronPort-AV: E=McAfee;i="6800,10657,11895"; a="88863629" X-IronPort-AV: E=Sophos;i="6.25,260,1779174000"; d="scan'208";a="88863629" X-CSE-ConnectionGUID: D+zeAhi1QaOQ3l+uckAhbg== X-CSE-MsgGUID: U/LqOTVVSRipwlCwAZP4ag== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,260,1779174000"; d="scan'208";a="269990820" From: Jedrzej Wasiukiewicz To: devel@lists.libvirt.org Subject: [PATCH v2 2/2] qemu: omit empty cache monitor domstats Date: Fri, 4 Sep 2026 12:23:22 +0200 Message-ID: <20260904102322.583641-3-jedrzej.wasiukiewicz@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260904102322.583641-1-jedrzej.wasiukiewicz@intel.com> References: <20260904102322.583641-1-jedrzej.wasiukiewicz@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: H36UE4R2KE3NQ575MGDWMVQMJZRFGVDI X-Message-ID-Hash: H36UE4R2KE3NQ575MGDWMVQMJZRFGVDI X-MailFrom: jedrzej.wasiukiewicz@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: "Christopher M . Cantalupo" , Michal Privoznik X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1788517582755154100 Content-Type: text/plain; charset="utf-8" qemuDomainGetStatsCpuCache reports cpu.cache.monitor.count=3D0 when no cache monitors are available. The memory bandwidth and energy collectors instead omit their monitor fields when there is no monitor data. Return early when no cache monitor data is available to make the three resctrl domstats collectors consistent. Signed-off-by: Jedrzej Wasiukiewicz Reviewed-by: Christopher M. Cantalupo Reviewed-by: Michal Privoznik --- src/qemu/qemu_driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 9abd4d5618..8498568623 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17577,6 +17577,9 @@ qemuDomainGetStatsCpuCache(virQEMUDriver *driver, return; } =20 + if (nresdata =3D=3D 0) + return; + virTypedParamListAddUInt(params, nresdata, VIR_DOMAIN_STATS_CPU_CACHE_MONITOR_COUNT); =20 --=20 2.43.0 --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydz= ial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-31= 6 | Kapital zakladowy 200.000 PLN. Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu usta= wy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w trans= akcjach handlowych. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata= i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wi= adomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiek= olwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). If you are not the intended recipient= , please contact the sender and delete all copies; any review or distributi= on by others is strictly prohibited.