From nobody Fri Dec 19 08:07:08 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1634654657; cv=none; d=zohomail.com; s=zohoarc; b=H72Q8dusJz02xdLhp8Ut6W5/BEAp99u+C8uzZ08IUVkwRDKd52bMnwhZLE4OMo2dOoCd0I4Nz9lb/a1XF+NGgFhKl4Q+rNyK9xMtFQHlq1miBlVShu6lGVZsAG243cqwq0KdjxKz67C3mdfZXA3YDHFWL+oGZdzvxDmHlLS+f0Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1634654657; 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=eO74xyRVzkuxblb/cI4aFWg0UHkYOJcU68QgAJPLQWo=; b=Iz4ElQAPQ8X+hXsJ2xqp9UYrEKyNjZJSxTbIuQg+Hu7vhap2+93O05jhxUjiYcliAwfK46Dw2V2w0mwz+cIsVEzxXPDE9kV019ZzsYmuAkluIiUYmlNI2d1hipuRUirBd0wQNAIIWfnyvq4u0V+1yKy92alUGU9xxenDu6kqnFU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1634654657130205.7667744579586; Tue, 19 Oct 2021 07:44:17 -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-337-URp6EnhdPIiX7WAQu1kDBA-1; Tue, 19 Oct 2021 10:44:14 -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 EEFE0180830C; Tue, 19 Oct 2021 14:44:08 +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 D220018A8F; Tue, 19 Oct 2021 14:44:08 +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 94E734EA31; Tue, 19 Oct 2021 14:44:08 +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 19JEhOih031737 for ; Tue, 19 Oct 2021 10:43:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8A73B19723; Tue, 19 Oct 2021 14:43:24 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF2C619C79 for ; Tue, 19 Oct 2021 14:43:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634654656; 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=eO74xyRVzkuxblb/cI4aFWg0UHkYOJcU68QgAJPLQWo=; b=EVgPmous0/8TU+MuLWUZKlLs8otr1q6edQAsmmNxqV4v0d7GQpL0KYtOB7AR7V4d1wiSLd VSoDY8xCsDolKAmWX/keS1/a3MzfceIdBR6t+wC4OMZajdeb+ZNHGYFxz8e0fq5/nxuash DsDX5HE03v92sHO6aaflJXMrR5QY7g8= X-MC-Unique: URp6EnhdPIiX7WAQu1kDBA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 7/8] qemuMonitorGetAllBlockStatsInfo: Remove 'backingChain' argument Date: Tue, 19 Oct 2021 16:43:14 +0200 Message-Id: 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: 1634654657504100001 Content-Type: text/plain; charset="utf-8" All (proper) callers pass true so we can remove the argument. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 4 ++-- src/qemu/qemu_monitor.c | 13 ++++--------- src/qemu/qemu_monitor.h | 3 +-- src/qemu/qemu_monitor_json.c | 15 +++++---------- src/qemu/qemu_monitor_json.h | 3 +-- tests/qemumonitorjsontest.c | 2 +- 6 files changed, 14 insertions(+), 26 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 822fd99ae2..587a673efc 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -10051,7 +10051,7 @@ qemuDomainBlocksStatsGather(virQEMUDriver *driver, } qemuDomainObjEnterMonitor(driver, vm); - nstats =3D qemuMonitorGetAllBlockStatsInfo(priv->mon, &blockstats, tru= e); + nstats =3D qemuMonitorGetAllBlockStatsInfo(priv->mon, &blockstats); if (capacity && nstats >=3D 0) { if (blockdev) @@ -18477,7 +18477,7 @@ qemuDomainGetStatsBlock(virQEMUDriver *driver, if (HAVE_JOB(privflags) && virDomainObjIsActive(dom)) { qemuDomainObjEnterMonitor(driver, dom); - rc =3D qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats, true); + rc =3D qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats); if (rc >=3D 0) { if (blockdev) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index e8accaf2b0..166f7958f0 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2056,27 +2056,22 @@ qemuMonitorQueryBlockstats(qemuMonitor *mon) * qemuMonitorGetAllBlockStatsInfo: * @mon: monitor object * @ret_stats: pointer that is filled with a hash table containing the sta= ts - * @backingChain: recurse into the backing chain of devices * - * Creates a hash table in @ret_stats with block stats of all devices. In = case - * @backingChain is true @ret_stats will additionally contain stats for - * backing chain members of block devices. + * Creates a hash table in @ret_stats with block stats of all devices and = the + * backing chains for the block devices. * * Returns < 0 on error, count of supported block stats fields on success. */ int qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon, - GHashTable **ret_stats, - bool backingChain) + GHashTable **ret_stats) { int ret; g_autoptr(GHashTable) stats =3D virHashNew(g_free); - VIR_DEBUG("ret_stats=3D%p, backing=3D%d", ret_stats, backingChain); - QEMU_CHECK_MONITOR(mon); - ret =3D qemuMonitorJSONGetAllBlockStatsInfo(mon, stats, backingChain); + ret =3D qemuMonitorJSONGetAllBlockStatsInfo(mon, stats); if (ret < 0) return -1; diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 52ff34d316..e28d45cc4a 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -738,8 +738,7 @@ struct _qemuBlockStats { }; int qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon, - GHashTable **ret_stats, - bool backingChain) + GHashTable **ret_stats) ATTRIBUTE_NONNULL(2); int qemuMonitorBlockStatsUpdateCapacity(qemuMonitor *mon, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 6cf36d2518..af673b5ba6 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2469,8 +2469,7 @@ static int qemuMonitorJSONGetOneBlockStatsInfo(virJSONValue *dev, const char *dev_name, int depth, - GHashTable *hash, - bool backingChain) + GHashTable *hash) { g_autofree qemuBlockStats *bstats =3D NULL; int nstats =3D 0; @@ -2507,10 +2506,8 @@ qemuMonitorJSONGetOneBlockStatsInfo(virJSONValue *de= v, qemuMonitorJSONAddOneBlockStatsInfo(bstats, nodename, hash) < 0) return -1; - if (backingChain && - (backing =3D virJSONValueObjectGetObject(dev, "backing")) && - qemuMonitorJSONGetOneBlockStatsInfo(backing, dev_name, depth + 1, - hash, true) < 0) + if ((backing =3D virJSONValueObjectGetObject(dev, "backing")) && + qemuMonitorJSONGetOneBlockStatsInfo(backing, dev_name, depth + 1, = hash) < 0) return -1; return nstats; @@ -2538,8 +2535,7 @@ qemuMonitorJSONQueryBlockstats(qemuMonitor *mon) int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitor *mon, - GHashTable *hash, - bool backingChain) + GHashTable *hash) { int nstats =3D 0; int rc; @@ -2570,8 +2566,7 @@ qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitor *mon, if (*dev_name =3D=3D '\0') dev_name =3D NULL; - rc =3D qemuMonitorJSONGetOneBlockStatsInfo(dev, dev_name, 0, hash, - backingChain); + rc =3D qemuMonitorJSONGetOneBlockStatsInfo(dev, dev_name, 0, hash); if (rc < 0) return -1; diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index c841de0a03..c60f079d06 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -77,8 +77,7 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitor *mon, virJSONValue *qemuMonitorJSONQueryBlockstats(qemuMonitor *mon); int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitor *mon, - GHashTable *hash, - bool backingChain); + GHashTable *hash); int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitor *mon, GHashTable *stats, bool backingChain); diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 30a19d27e8..e5ba39cd2f 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1657,7 +1657,7 @@ testQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInf= o(const void *opaque) CHECK0FULL(wr_highest_offset_valid, WR_HIGHEST_OFFSET_VALID, "%d", "%d= ") if (qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorTestGetMonitor(test= ), - blockstats, false) < 0) + blockstats) < 0) return -1; if (!blockstats) { --=20 2.31.1