From nobody Thu Mar 28 19:14:37 2024 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=1667989086; cv=none; d=zohomail.com; s=zohoarc; b=Fqf+Q7y1prXgOWcvxd/e3KUu6qOtIsJQhqCHyGl/SFjk8Wqhqc9zA43bP1CwB1IxYDiXjVuOxjoDVeZKe8A4YFMkBjC5uJkREVIcXDGNV82MtfZLgVhm6huOFRmGUeZJu+eb+Vnw7x4okNj3szesdCeWIN76M6I7ACIU67oc+o8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667989086; 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=zHQ3ZTfx+g0WSKPXWRfuD57kngWtlPc4bMolfMbVI1g=; b=bDEURNvNCUqyKtRHbH+/llHztNcsDE3YZP1IZlI4DANebPLXZjbMpIJ6k5SSxSQDw55RVrN18KJNvYtNljWvq7i1N87B2vMuE4+XUzTU89IjIZeIGK2aWVyb1c7wad3zi7n4SHZmOSTE/PTQwJwR+f/MK8U8YiwvQCqPE5gj+ZE= 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 1667989086340711.5829315964667; Wed, 9 Nov 2022 02:18:06 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-483-ZYOylavkO7WxQS1ukHmpZQ-1; Wed, 09 Nov 2022 05:17:24 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 550B2101AA46; Wed, 9 Nov 2022 10:17:22 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41C54492B17; Wed, 9 Nov 2022 10:17:22 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2491D1946594; Wed, 9 Nov 2022 10:17:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 698111946588 for ; Wed, 9 Nov 2022 10:17:20 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4F0B72166B2E; Wed, 9 Nov 2022 10:17:20 +0000 (UTC) Received: from speedmetal.redhat.com (ovpn-208-16.brq.redhat.com [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97E492166B29 for ; Wed, 9 Nov 2022 10:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667989085; 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=zHQ3ZTfx+g0WSKPXWRfuD57kngWtlPc4bMolfMbVI1g=; b=GYCZuPxgGicwyQCX4hXKkWZS7LHWIQPba7l53A8fbcTzt2PzFUfJNJEjZ5IHIVxxrZirLN s69N5fxjaX2zWR+TJc+kgoal4+PMEZpIKbsCzdzXKX6ba+OWyp8wiEX/nzAaz2kY2dRsux ewht39Zo7lKwou1skSi0LkNedEQgdMg= X-MC-Unique: ZYOylavkO7WxQS1ukHmpZQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/4] qemu: qemuBlockGetNamedNodeData: Remove pointless error path Date: Wed, 9 Nov 2022 11:17:12 +0100 Message-Id: <7e998b6645d296a82995b5a3f9d2b769eae30fe6.1667988987.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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: 1667989087236100001 Content-Type: text/plain; charset="utf-8" We don't need automatic freeing for 'blockNamedNodeData' and we can directly return it rather than checking it for NULL-ness first. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index b82e3311e1..e98b5d4739 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -2610,7 +2610,7 @@ qemuBlockGetNamedNodeData(virDomainObj *vm, virDomainAsyncJob asyncJob) { qemuDomainObjPrivate *priv =3D vm->privateData; - g_autoptr(GHashTable) blockNamedNodeData =3D NULL; + GHashTable *blockNamedNodeData =3D NULL; bool supports_flat =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NO= DES_FLAT); @@ -2621,10 +2621,7 @@ qemuBlockGetNamedNodeData(virDomainObj *vm, qemuDomainObjExitMonitor(vm); - if (!blockNamedNodeData) - return NULL; - - return g_steal_pointer(&blockNamedNodeData); + return blockNamedNodeData; } --=20 2.37.3 From nobody Thu Mar 28 19:14:37 2024 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=1667989052; cv=none; d=zohomail.com; s=zohoarc; b=Aj1EhaB43D+RRo2PRlNQqkn6RIpwGmXODO+zKva5H+4cj9CMiwPkZDnrGz0nppr7Zf9DwJqwVaGJmzh92w/HkkSpZeDWFx9T8iBaMrJtzpfn9doMMZi/lptyqrinJNeU0ubYuS4WxLNWh21s/7tdx/4LfLGY3O3x53p3HBVU5L0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667989052; 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=9LqyQvTUhKyDdlXhFvzPNWxlT73JypJmKwvlIOWOhTw=; b=iqE1ZQmeXI36ns+LxXOCvizWOwoxuT+aht/bfl0WvbB8YgWNw7yr434GVLjWTGX+9OLZBJZp+DWIm8Zf1PJxbBHj8LCZCZ2ATE4aH0jQQ4IV3diJnyB/0ha62QsR8/czbpC0F6FcD6CURV+Sx+4zDEECGwOfzqNeU1BuKZnEr/k= 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 1667989052599924.319528810348; Wed, 9 Nov 2022 02:17:32 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-329-0m6hCtOZMY-UGPXVsiQg-w-1; Wed, 09 Nov 2022 05:17:26 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B5CA9806004; Wed, 9 Nov 2022 10:17:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1392112131B; Wed, 9 Nov 2022 10:17:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 91395194658F; Wed, 9 Nov 2022 10:17:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 77A461946588 for ; Wed, 9 Nov 2022 10:17:21 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6B5B12166B2E; Wed, 9 Nov 2022 10:17:21 +0000 (UTC) Received: from speedmetal.redhat.com (ovpn-208-16.brq.redhat.com [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id C42602166B29 for ; Wed, 9 Nov 2022 10:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667989051; 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=9LqyQvTUhKyDdlXhFvzPNWxlT73JypJmKwvlIOWOhTw=; b=ilKGTzrrnQhdfb9pPTZMDTFFQP4phzIddPn9lm/2aTQ8E0HkUnjWSPFL7tQXUu3XJ1XJUt nYXDfMpBB2LVe78p3wZw8KOp7/GD//5m0nxb4GiH3KtSibs3Mv23m55ONESUvZ4+5xGBI+ +vwJxg9ASmviGMnN5WbT2Mg3z7w2Dy8= X-MC-Unique: 0m6hCtOZMY-UGPXVsiQg-w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/4] qemu: monitor: Store whether 'query-named-block-nodes' supports 'flat' parameter Date: Wed, 9 Nov 2022 11:17:13 +0100 Message-Id: <61d7bbb51776f41a67b9bd9f54f10de225b0914a.1667988987.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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: 1667989053157100003 Content-Type: text/plain; charset="utf-8" Rather than having callers always pass this flag store it in the qemuMonitor object. Following patches will convert the code to use this internal flag. In the future this will also simplify removal when all supported qemu versions will support the new mode. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor.c | 4 +++- src/qemu/qemu_monitor_priv.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index d09c561e47..dd394cd19b 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -622,8 +622,10 @@ qemuMonitorOpenInternal(virDomainObj *vm, mon->waitGreeting =3D true; mon->cb =3D cb; - if (priv) + if (priv) { mon->objectAddNoWrap =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_= OBJECT_JSON); + mon->queryNamedBlockNodesFlat =3D virQEMUCapsGet(priv->qemuCaps, Q= EMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT); + } if (virSetCloseExec(mon->fd) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, diff --git a/src/qemu/qemu_monitor_priv.h b/src/qemu/qemu_monitor_priv.h index 2f7c662cef..0826a1da94 100644 --- a/src/qemu/qemu_monitor_priv.h +++ b/src/qemu/qemu_monitor_priv.h @@ -90,6 +90,8 @@ struct _qemuMonitor { /* true if qemu no longer wants 'props' sub-object of object-add */ bool objectAddNoWrap; + /* query-named-block-nodes supports the 'flat' option */ + bool queryNamedBlockNodesFlat; }; --=20 2.37.3 From nobody Thu Mar 28 19:14:37 2024 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=1667989090; cv=none; d=zohomail.com; s=zohoarc; b=Qr8DHJH2qUDGndtZh3hbPe37/3jq0+jlugxF48Xa0kTjQNaVtldUIOocUokfmO1Dvif95Xn+T6iS/+7k6W5T+CnQNHdZUGU43thLeAC5X0z+zKw7I5EQQr2mlF19MQAfoWezg25TSdLZhNO0bMbKvpMKgv5Mmu31n6HBVRzyp9A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667989090; 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=zFgJn+b/b2somUNJJvKktzJshWkEswHKkHurch/JXjU=; b=Q+LFHySf4vgNoIqNDCJYg7g5Q+g2qaG1CJclTgoT9WtnBtSnOvhQ6x9V047LiJ51cRsqb72seq7T+4orSjr8XVTdTbUcHqVqnhSNpMTfMEsqZeclgBTbjOmSSznZS2lNXOnKAmpZmMyrmOgj/tDNedCz1slNURDS+MeOl1EPLug= 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 1667989090354437.0216538190032; Wed, 9 Nov 2022 02:18:10 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-644-GyhM3XL3O4WAvGegOaRuXQ-1; Wed, 09 Nov 2022 05:17:26 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2D6C680600C; Wed, 9 Nov 2022 10:17:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16E79492B1A; Wed, 9 Nov 2022 10:17:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CFC5A1946A41; Wed, 9 Nov 2022 10:17:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AAD82194658F for ; Wed, 9 Nov 2022 10:17:22 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8D9FA2166B37; Wed, 9 Nov 2022 10:17:22 +0000 (UTC) Received: from speedmetal.redhat.com (ovpn-208-16.brq.redhat.com [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id D98142166B2E for ; Wed, 9 Nov 2022 10:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667989089; 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=zFgJn+b/b2somUNJJvKktzJshWkEswHKkHurch/JXjU=; b=bbfsTvKMfYdbKjqfeZveex30Zk5wh7GyQW3crtCCanWcgA0oK8dykYedxpGop+/9ZSMgte L/B3J761Iast3Z5fLkm6uc4pzycEnsMeVvNUSxVkZj2kkQMzzCd97R4ikDK9UzekBocxsQ U/k5UKmn8o/yJbW8QVQs3riLekyRx/Q= X-MC-Unique: GyhM3XL3O4WAvGegOaRuXQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/4] qemuMonitorJSONBlockStatsUpdateCapacityBlockdev: Use 'flat' mode of query-named-block-nodes Date: Wed, 9 Nov 2022 11:17:14 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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: 1667989091265100001 Content-Type: text/plain; charset="utf-8" 'query-named-block-nodes' in non-flat mode returns redundantly nested data under the 'backing-image' field. Fortunately we don't need it when updating the capacity stats. This function was unfortunately not fixed originally when the support for flat mode was added. Use the flat cached in the monitor object to force flat mode if available. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 8a3421a6fc..0e34cb55ad 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2503,7 +2503,7 @@ qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuM= onitor *mon, { g_autoptr(virJSONValue) nodes =3D NULL; - if (!(nodes =3D qemuMonitorJSONQueryNamedBlockNodes(mon, false))) + if (!(nodes =3D qemuMonitorJSONQueryNamedBlockNodes(mon, mon->queryNam= edBlockNodesFlat))) return -1; if (virJSONValueArrayForeachSteal(nodes, --=20 2.37.3 From nobody Thu Mar 28 19:14:37 2024 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=1667989054; cv=none; d=zohomail.com; s=zohoarc; b=bHEQ9+p24CXOkZJ0FJaoiycTpAqw13sHcwAXcgba/aWpck80nhV/QtXgckr4okdeaVWIIZ7RJWgwDBySbb3yGOxxoGM2o0L6zIbU3tOJLr2pJ2pUEEeo2Rh30KKc9+fkbe6ugxMCNA+81/00fMw8rBfFIGnlCIfuKiRhU789ltw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667989054; 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=X6NIYqX9BQmvB4sExQ7f2zqV2LNI5XTWlacbaBod2Is=; b=Gwv0GiJ7t7pT6TOWMy8vLxs//YPEWLeEtcae58Ss9DISuYLscxwskBDiTQ2kyd3YYl+LRAOIlX2bRUCpAfnE5x5ssJrGurSXgavEasew1oR/6XPNNRfA6jF4jRj0FiEeARiiRPRzRZExM9EZMzVwuUvglBJJUf2FU3Xp9J/UJkg= 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 1667989054635922.2365475051182; Wed, 9 Nov 2022 02:17:34 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-3-_yryB0OaN2qQH_-XTYsZLg-1; Wed, 09 Nov 2022 05:17:29 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4F8F8811E81; Wed, 9 Nov 2022 10:17:25 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C546140EBF5; Wed, 9 Nov 2022 10:17:25 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2D6AF194658F; Wed, 9 Nov 2022 10:17:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D84231946A44 for ; Wed, 9 Nov 2022 10:17:23 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C791A2166B30; Wed, 9 Nov 2022 10:17:23 +0000 (UTC) Received: from speedmetal.redhat.com (ovpn-208-16.brq.redhat.com [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 209302166B29 for ; Wed, 9 Nov 2022 10:17:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667989053; 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=X6NIYqX9BQmvB4sExQ7f2zqV2LNI5XTWlacbaBod2Is=; b=AOXUXxCwYIam7RWlyz3qERhVddVDU+1bmL4g8UwxbbeiFbbmhunAhyHBm84pz7OKBCScBY OyU52CSfsL5LI7hOQjcmcyNhNUneOWoiZaR1B0PZ6Vh24oN49Xm8anaoUl9zrXaM/wGG6q 71DZki7Xtkmm3J5dXWP2wg5lwg6iT4Y= X-MC-Unique: _yryB0OaN2qQH_-XTYsZLg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/4] qemuMonitorJSONQueryNamedBlockNodes: Drop 'flat' argument Date: Wed, 9 Nov 2022 11:17:15 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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: 1667989055076100005 Content-Type: text/plain; charset="utf-8" All callers pass the equivalent of looking up whether qemu supports QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT. Use 'mon->queryNamedBlockNodesFlat' directly and refactor all callers. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 4 +--- src/qemu/qemu_monitor.c | 7 ++----- src/qemu/qemu_monitor.h | 3 +-- src/qemu/qemu_monitor_json.c | 12 +++++------- src/qemu/qemu_monitor_json.h | 3 +-- 5 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index e98b5d4739..8a6f601b29 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -2611,13 +2611,11 @@ qemuBlockGetNamedNodeData(virDomainObj *vm, { qemuDomainObjPrivate *priv =3D vm->privateData; GHashTable *blockNamedNodeData =3D NULL; - bool supports_flat =3D virQEMUCapsGet(priv->qemuCaps, - QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NO= DES_FLAT); if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0) return NULL; - blockNamedNodeData =3D qemuMonitorBlockGetNamedNodeData(priv->mon, sup= ports_flat); + blockNamedNodeData =3D qemuMonitorBlockGetNamedNodeData(priv->mon); qemuDomainObjExitMonitor(vm); diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index dd394cd19b..cd9f43071e 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1990,20 +1990,17 @@ qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMon= itor *mon, /** * qemuMonitorBlockGetNamedNodeData: * @mon: monitor object - * @supports_flat: don't query data for backing store * * Uses 'query-named-block-nodes' to retrieve information about individual * storage nodes and returns them in a hash table of qemuBlockNamedNodeDat= a *s * filled with the data. The hash table keys are node names. */ GHashTable * -qemuMonitorBlockGetNamedNodeData(qemuMonitor *mon, - bool supports_flat) +qemuMonitorBlockGetNamedNodeData(qemuMonitor *mon) { QEMU_CHECK_MONITOR_NULL(mon); - VIR_DEBUG("supports_flat=3D%d", supports_flat); - return qemuMonitorJSONBlockGetNamedNodeData(mon, supports_flat); + return qemuMonitorJSONBlockGetNamedNodeData(mon); } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 5a84a4d095..62f1bc1299 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -712,8 +712,7 @@ struct _qemuBlockNamedNodeData { }; GHashTable * -qemuMonitorBlockGetNamedNodeData(qemuMonitor *mon, - bool supports_flat); +qemuMonitorBlockGetNamedNodeData(qemuMonitor *mon); int qemuMonitorBlockResize(qemuMonitor *mon, const char *device, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 0e34cb55ad..74967afb24 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2037,14 +2037,13 @@ qemuMonitorJSONSetDBusVMStateIdList(qemuMonitor *mo= n, * Returns: NULL on error, reply on success */ static virJSONValue * -qemuMonitorJSONQueryNamedBlockNodes(qemuMonitor *mon, - bool flat) +qemuMonitorJSONQueryNamedBlockNodes(qemuMonitor *mon) { g_autoptr(virJSONValue) cmd =3D NULL; g_autoptr(virJSONValue) reply =3D NULL; if (!(cmd =3D qemuMonitorJSONMakeCommand("query-named-block-nodes", - "B:flat", flat, + "B:flat", mon->queryNamedBlockN= odesFlat, NULL))) return NULL; @@ -2503,7 +2502,7 @@ qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuM= onitor *mon, { g_autoptr(virJSONValue) nodes =3D NULL; - if (!(nodes =3D qemuMonitorJSONQueryNamedBlockNodes(mon, mon->queryNam= edBlockNodesFlat))) + if (!(nodes =3D qemuMonitorJSONQueryNamedBlockNodes(mon))) return -1; if (virJSONValueArrayForeachSteal(nodes, @@ -2669,12 +2668,11 @@ qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONVal= ue *nodes) GHashTable * -qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon, - bool supports_flat) +qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon) { g_autoptr(virJSONValue) nodes =3D NULL; - if (!(nodes =3D qemuMonitorJSONQueryNamedBlockNodes(mon, supports_flat= ))) + if (!(nodes =3D qemuMonitorJSONQueryNamedBlockNodes(mon))) return NULL; return qemuMonitorJSONBlockGetNamedNodeDataJSON(nodes); diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index c0abc9dd4f..4c65838b7e 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -105,8 +105,7 @@ GHashTable * qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValue *nodes); GHashTable * -qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon, - bool supports_flat); +qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon); int qemuMonitorJSONBlockResize(qemuMonitor *mon, --=20 2.37.3