From nobody Fri Dec 19 08:23:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1634654772; cv=none; d=zohomail.com; s=zohoarc; b=mRFQ+mNdrHnDP4xBvlWYP1NTcFboKJh3u111xiDo1B4VqLke3QT9hNRoZqZRhK/rCWni84EPCldAAZknhWFuVVOPj5Rcc35rNfJB299tA0IlLX2Am+TM5f4iabSxbXgHCs6SSFqHrlT+1CjE/71bq7/dQsIU6IKk8C48T6vxDKY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1634654772; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jEHn1twcTPkOYV8DNLgEPlSrb23gJMhRSvDOJkOo4j4=; b=iepuNpK7crxXIGWppQoM2ZnHvDVgL+UdJEw2JFM2q6N5fN3sIC0Nv5wyWvoDF+JI1rVSPO6zUTVxjutHrfa/0sZPvwV4AxdNg5iq2sQi+r44TsmPZ6Ej8T3dALvtSnOimSuvePgaRfPklbv5gHqB7yStZzQd1A/VaeGP750znPM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 163465477272250.288257207155425; Tue, 19 Oct 2021 07:46:12 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-507-wObWWUiNNDyJTpMtirpqAw-1; Tue, 19 Oct 2021 10:44:12 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4D5A9101F7A5; Tue, 19 Oct 2021 14:44:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 306225B826; Tue, 19 Oct 2021 14:44:07 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E84214EA2F; Tue, 19 Oct 2021 14:44:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 19JEhIBC031675 for ; Tue, 19 Oct 2021 10:43:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1E19019D9F; Tue, 19 Oct 2021 14:43:18 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 83F6619C79 for ; Tue, 19 Oct 2021 14:43:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634654771; h=from:from:sender:sender: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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=jEHn1twcTPkOYV8DNLgEPlSrb23gJMhRSvDOJkOo4j4=; b=SIhi/7+01eZ2kB/jx+k0GVuq2kzUc6Ml63ZAfdwbwZcHmKFHsDpUslibK5G7wjKXk9RLQQ qbfZ71UrO0xqx1a6YZjh+xPCQX4V4W+SgjU2Ts8YNtkDAFndkbbZi3xsnbjbgN4m0be8z8 kiG4P6YbaLuIw7zxNkE8XLBrJN436Sw= X-MC-Unique: wObWWUiNNDyJTpMtirpqAw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/8] qemuDomainBlocksStatsGather: Always fetch stats for the full backing chain Date: Tue, 19 Oct 2021 16:43:08 +0200 Message-Id: <175565673560b041a0f8ffaf58b70f4d393394e7.1634654476.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1634654773420100001 Content-Type: text/plain; charset="utf-8" In certain cases such as when running a backup blockjob qemu installs a filter node between the frontend and the top node of the backend of the disk. The stats gathering code didn't instruct the monitor code to fetch the stats for all the layers, so since the top layer now doesn't have stats we were reporting wrong stats such as allocation. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2015281 Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b9cc8f8379..34da87e330 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -10051,13 +10051,13 @@ qemuDomainBlocksStatsGather(virQEMUDriver *driver, } qemuDomainObjEnterMonitor(driver, vm); - nstats =3D qemuMonitorGetAllBlockStatsInfo(priv->mon, &blockstats, fal= se); + nstats =3D qemuMonitorGetAllBlockStatsInfo(priv->mon, &blockstats, tru= e); if (capacity && nstats >=3D 0) { if (blockdev) rc =3D qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->mon, = blockstats); else - rc =3D qemuMonitorBlockStatsUpdateCapacity(priv->mon, blocksta= ts, false); + rc =3D qemuMonitorBlockStatsUpdateCapacity(priv->mon, blocksta= ts, true); } if (qemuDomainObjExitMonitor(driver, vm) < 0 || nstats < 0 || rc < 0) --=20 2.31.1