From nobody Fri Dec 12 14:05:55 2025 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1761668184; cv=none; d=zohomail.com; s=zohoarc; b=ZAo+Ag+4RWGL7XPq4MDWNvl6UhRXZeNd7OM+nNg35CVRIyFimtq2aqxEF2HOrgOSSj1qjXeiY2WRo03jEP44LzLaxcNQ2+AT9n2WSS3HVT3OiNdar44w9bCuhmc+e4AjG+Qdit0BDQyZWBaLahOCLezgpSAa7gFsHZy3P6Fg77c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761668184; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id:Cc; bh=11jeqFXNz81uMVXpJbwMWy2KT9nlFe6xeQszSPQphO0=; b=HmfA0DHsqsSHQ8PYo80ELHBjl/sKN+28AvwHe7W9OLo3127YqlgLncCRV6lP4P7Kt8aHuLtK7ysbVbNIjSRBFybC2OhFIkb+RE8V0M2uvTckdtDdXY8+jXdRAQvEBrhsBsKnh+fctdtk5XasnsG1RfIg10NjFu9b4z5vAoO+1nQ= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1761668184104869.660494128861; Tue, 28 Oct 2025 09:16:24 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 4A8E5418A0; Tue, 28 Oct 2025 12:16:22 -0400 (EDT) Received: from [172.19.199.29] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id D63BC419CA; Tue, 28 Oct 2025 12:15:04 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 2D58D41885; Tue, 28 Oct 2025 12:13:25 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 1BC1741895 for ; Tue, 28 Oct 2025 12:13:23 -0400 (EDT) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-574-fII8LRKdM5uDsXKh5sShyg-1; Tue, 28 Oct 2025 12:13:21 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3BBB31955F45 for ; Tue, 28 Oct 2025 16:13:19 +0000 (UTC) Received: from speedmetal.openshiftapps.com (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 707291800581 for ; Tue, 28 Oct 2025 16:13:18 +0000 (UTC) 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,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761668002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=11jeqFXNz81uMVXpJbwMWy2KT9nlFe6xeQszSPQphO0=; b=SJAGxYz8Pc+6eUVnBtzEwo3R1COTZGYEZza0tc3s30hfgn4XbrlaKo+59tHXLleDSlVgZm qFZIMuCNlu/cS+6uZA6lYgHLr2a5OExtduxCq0fQvUSM1OSM/45s9uXnNGXaPwNTYcvO3Z a17VAZiSPQfnnWz9MKOaOPs8dYcp5Tc= X-MC-Unique: fII8LRKdM5uDsXKh5sShyg-1 X-Mimecast-MFC-AGG-ID: fII8LRKdM5uDsXKh5sShyg_1761667999 To: devel@lists.libvirt.org Subject: [PATCH] qemuDomainBlocksStatsGather: Fix blockstats gathering after refactor Date: Tue, 28 Oct 2025 17:13:17 +0100 Message-ID: <65ac8842419eb0ee974d2c401df86171d7e4767a.1761667997.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: SyCWvBYLXz7s4KiyDhoUctSTaFw3juFnmEYqJjNcYK8_1761667999 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: AQ2T3ULSSGTFUSVZ6XQTLSLTOIJSUVJ2 X-Message-ID-Hash: AQ2T3ULSSGTFUSVZ6XQTLSLTOIJSUVJ2 X-MailFrom: pkrempa@redhat.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 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: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1761668185413154100 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Commit 58aa005f3e95114 which refactored how block stats are stored intended to change the code path where stats for all devices are totaled together by allocating new stats object and using that but the commit forgot to actually change the pointers inside the loop. Unfortunately this was not caught by the compiler as there were pre-existing pointers of the same type with the same name, which resulted into a NULL dereference. Fixes: 58aa005f3e95114b4f2dab76ee4ade06182a3f20 Closes: https://gitlab.com/libvirt/libvirt/-/issues/827 Signed-off-by: Peter Krempa Reviewed-by: Jiri Denemark --- src/qemu/qemu_driver.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b0eff443aa..5fe4568d98 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9657,6 +9657,8 @@ qemuDomainBlocksStatsGather(virDomainObj *vm, g_autoptr(qemuBlockStats) stats =3D qemuBlockStatsNew(); for (i =3D 0; i < vm->def->ndisks; i++) { + qemuBlockStats *entry; + disk =3D vm->def->disks[i]; entryname =3D disk->info.alias; @@ -9670,13 +9672,13 @@ qemuDomainBlocksStatsGather(virDomainObj *vm, if (!entryname) continue; - if (!(stats =3D virHashLookup(blockstats, entryname))) { + if (!(entry =3D virHashLookup(blockstats, entryname))) { virReportError(VIR_ERR_INTERNAL_ERROR, _("cannot find statistics for device '%1$s'= "), entryname); return -1; } - qemuDomainBlockStatsGatherTotals(stats, *retstats); + qemuDomainBlockStatsGatherTotals(entry, stats); } *retstats =3D g_steal_pointer(&stats); --=20 2.51.0