From nobody Sat Feb 7 08:45:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1635778089; cv=none; d=zohomail.com; s=zohoarc; b=WDe6Ap9pgTqckCAX+LTP1+/B5B9a10Pn2QH9dwsQfkEF2RVsWtiCrboy9Xq+tCpPHJIyoYBBnRqtBxWshns7o+jIw4ssg2Tz6qfdRpPSCkU+kug3+2s6G95iQBsbNHFufLNGTJaz33VmGVmv/LU5dyq8vDQ0JxbI/xV6ojpDQ2o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635778089; 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=iCFjdD1rwg6gqfvpyCkHnb1RxOxY6OeEQEv2mfD5dDk=; b=TjRaI98DMyrw04ibccI1x2HxfLzlUXtbSnhoUM4hSAwYZxlQf9IYqBVvZihg7xeFaZAqbHsWSyeH6LekTeF5LFFXVoOtWmRV+6tMg8Sk6eagWvUmYIGmMt3lHS5LZG/x2mjQUIw5GVfbfVuwQdXH21BzXoFcETGcdVQ1XM9m0pk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1635778089936899.3763157535494; Mon, 1 Nov 2021 07:48:09 -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-554-Cs6DYa7nOe2R0ksKioTh6A-1; Mon, 01 Nov 2021 10:48:07 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4F03E8030A0; Mon, 1 Nov 2021 14:48:00 +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 28BF75F4F7; Mon, 1 Nov 2021 14:48:00 +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 DAC844EA39; Mon, 1 Nov 2021 14:47:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A1EltZs026284 for ; Mon, 1 Nov 2021 10:47:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5032B60C17; Mon, 1 Nov 2021 14:47:55 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E3F360C0F for ; Mon, 1 Nov 2021 14:47:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635778088; 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=iCFjdD1rwg6gqfvpyCkHnb1RxOxY6OeEQEv2mfD5dDk=; b=g0Va2l0B3PdDPwk4jQVT9o2nzh6i0QcJ04g8D9FLgXiG90umsQnnQKtsv5T3f4RJ1RETWK gZNzQiZTWRXWNLCiN3sikfSsYhPK+mSKDnJZGRRq2iO4VsMzIgjRQTHDkus+dQ0fF2pekK hMDHj4L1dNvPoKVRJEUJm8B/N/f9DfA= X-MC-Unique: Cs6DYa7nOe2R0ksKioTh6A-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/4] qemuDomainGetStatsBlockExportDisk: Report stats also for helper images Date: Mon, 1 Nov 2021 15:47:48 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.15 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: 1635778091718100001 Content-Type: text/plain; charset="utf-8" Add stat entries also for the mirror destination and the backup job scratch/target file. This is possible with '-blockdev' as we use unique index for the entries. The stats are reported when the VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING is used. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2017928 Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 61 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 70b5f37e6b..7d13ae9754 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -113,6 +113,7 @@ #include "virdomaincheckpointobjlist.h" #include "virsocket.h" #include "virutil.h" +#include "backup_conf.h" #define VIR_FROM_THIS VIR_FROM_QEMU @@ -18453,6 +18454,66 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDef= *disk, break; } + /* in blockdev mode where we can properly and uniquely identify images= we + * can also report stats for the mirror target or the scratch image or= target + * of a backup operation */ + if (visitBacking && blockdev) { + qemuDomainObjPrivate *priv =3D dom->privateData; + + if (disk->mirror && + disk->mirrorJob =3D=3D VIR_DOMAIN_BLOCK_JOB_TYPE_COPY) { + if (qemuDomainGetStatsBlockExportHeader(disk, disk->mirror, *r= ecordnr, params) < 0) + return -1; + + if (qemuDomainGetStatsOneBlock(driver, cfg, dom, params, + disk->mirror->nodeformat, + disk->mirror, + *recordnr, + stats) < 0) + return -1; + + if (qemuDomainGetStatsBlockExportBackendStorage(disk->mirror->= nodestorage, + stats, *record= nr, + params) < 0) + return -1; + + (*recordnr)++; + } + + if (priv->backup) { + size_t i; + + for (i =3D 0; i < priv->backup->ndisks; i++) { + virDomainBackupDiskDef *backupdisk =3D priv->backup->disks= + i; + + if (STRNEQ(disk->dst, priv->backup->disks[i].name)) + continue; + + if (backupdisk->store) { + if (qemuDomainGetStatsBlockExportHeader(disk, backupdi= sk->store, + *recordnr, par= ams) < 0) + return -1; + + if (qemuDomainGetStatsOneBlock(driver, cfg, dom, param= s, + backupdisk->store->node= format, + backupdisk->store, + *recordnr, + stats) < 0) + return -1; + + if (qemuDomainGetStatsBlockExportBackendStorage(backup= disk->store->nodestorage, + stats,= *recordnr, + params= ) < 0) + return -1; + + (*recordnr)++; + } + + break; + } + } + } + return 0; } --=20 2.31.1