From nobody Mon Dec 15 23:09:16 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=1658846408; cv=none; d=zohomail.com; s=zohoarc; b=jpwlyZ/7r+LQrT5kNAqAtolcC6y3ymzYvBig9iefmGgtzwWAmzV6niugzdkTZL7+46ZtTkDtCV+/wiNhKx4aX/7t2sAnlCUZ3DFwaLJ2W+XgBqW8WarqBOGOD/0TRSPcObzTk6dBDOjtwA6H5QbkgfsU+V4LCk+84b+TiBY9iK4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658846408; 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=sS4tDxjw7mmYXUny6aaoQrYWOcWk10JfBcKeIIyzUUI=; b=HZGSAN+rPrPpvX9hyXxAWCQSrdeP+eUc4ddoJeEQHohIol3Syr1Nr/JsBVKdkweGrIf2A315rO9Wbs/KkhOTmsjhaI0fSJB1uK5L/+1uu7e0Oxo2OLadovC6I3frVOOl/kFNwdBBR1uz9JlmawjRYY0JtdV+cT2dY7o61kBS4YM= 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 1658846408886583.9195839923267; Tue, 26 Jul 2022 07:40:08 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-126-WprYjaagMZiJhgDOIcYyUQ-1; Tue, 26 Jul 2022 10:39:16 -0400 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 7490D280EE57; Tue, 26 Jul 2022 14:38:46 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 592D21415122; Tue, 26 Jul 2022 14:38:46 +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 BA2D01947046; Tue, 26 Jul 2022 14:38:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 532C01947042 for ; Tue, 26 Jul 2022 14:38:41 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 33395400DFD7; Tue, 26 Jul 2022 14:38:41 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id ACA0F40CF8EE for ; Tue, 26 Jul 2022 14:38:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658846407; 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=sS4tDxjw7mmYXUny6aaoQrYWOcWk10JfBcKeIIyzUUI=; b=ZtbPUFjOe32RWJe+OQBWrVu0eO0yD4f5F6Pxi3DPiv+oRYDtUYqeFEK4uAgo2zH+Cfvyjk C5LK2QknFSdImcaOGsTyvFseJ1KXOYe+hh8a2t3ccMLc2bYGCqG2t7P7Gqf9hyBNz9HOLF ULaBlUpaCymrarC3DlgcDbOE0LKWz9g= X-MC-Unique: WprYjaagMZiJhgDOIcYyUQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 40/80] qemu: monitor: Remove unused qemuMonitorQueryNamedBlockNodes and clean up Date: Tue, 26 Jul 2022 16:37:18 +0200 Message-Id: <7b56f53e2ede5e803673dbc84ae3c71d88e6baf7.1658843187.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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 2.85 on 10.11.54.7 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: 1658846410587100002 Content-Type: text/plain; charset="utf-8" The top level API is unused so it can be removed but internally the JSON version is called by other monitor commands which extract information from the reply. Thus qemuMonitorJSONQueryNamedBlockNodes is unexported and moved appropriately. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/qemu_monitor.c | 9 ------- src/qemu/qemu_monitor.h | 2 -- src/qemu/qemu_monitor_json.c | 52 +++++++++++++++++++++--------------- src/qemu/qemu_monitor_json.h | 5 ---- 4 files changed, 30 insertions(+), 38 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index a58aa5622f..a4b1b90c7c 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3995,15 +3995,6 @@ qemuMonitorSetBlockThreshold(qemuMonitor *mon, } -virJSONValue * -qemuMonitorQueryNamedBlockNodes(qemuMonitor *mon) -{ - QEMU_CHECK_MONITOR_NULL(mon); - - return qemuMonitorJSONQueryNamedBlockNodes(mon, false); -} - - char * qemuMonitorGuestPanicEventInfoFormatMsg(qemuMonitorEventPanicInfo *info) { diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 0e3640c1da..352cf0ada5 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1335,8 +1335,6 @@ int qemuMonitorSetBlockThreshold(qemuMonitor *mon, const char *nodename, unsigned long long threshold); -virJSONValue *qemuMonitorQueryNamedBlockNodes(qemuMonitor *mon); - int qemuMonitorSetWatchdogAction(qemuMonitor *mon, const char *action); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 4584786872..9363f86a55 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2056,6 +2056,36 @@ qemuMonitorJSONSetDBusVMStateIdList(qemuMonitor *mon, } +/* qemuMonitorJSONQueryNamedBlockNodes: + * @mon: Monitor pointer + * + * This helper will attempt to make a "query-named-block-nodes" call and c= heck for + * errors before returning with the reply. + * + * Returns: NULL on error, reply on success + */ +static virJSONValue * +qemuMonitorJSONQueryNamedBlockNodes(qemuMonitor *mon, + bool flat) +{ + g_autoptr(virJSONValue) cmd =3D NULL; + g_autoptr(virJSONValue) reply =3D NULL; + + if (!(cmd =3D qemuMonitorJSONMakeCommand("query-named-block-nodes", + "B:flat", flat, + NULL))) + return NULL; + + if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) + return NULL; + + if (qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_ARRAY) < 0) + return NULL; + + return virJSONValueObjectStealArray(reply, "return"); +} + + /* qemuMonitorJSONQueryBlock: * @mon: Monitor pointer * @@ -7882,28 +7912,6 @@ qemuMonitorJSONSetBlockThreshold(qemuMonitor *mon, } -virJSONValue * -qemuMonitorJSONQueryNamedBlockNodes(qemuMonitor *mon, - bool flat) -{ - g_autoptr(virJSONValue) cmd =3D NULL; - g_autoptr(virJSONValue) reply =3D NULL; - - if (!(cmd =3D qemuMonitorJSONMakeCommand("query-named-block-nodes", - "B:flat", flat, - NULL))) - return NULL; - - if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - return NULL; - - if (qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_ARRAY) < 0) - return NULL; - - return virJSONValueObjectStealArray(reply, "return"); -} - - int qemuMonitorJSONSetWatchdogAction(qemuMonitor *mon, const char *action) diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 613b251908..31f6214ec4 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -713,11 +713,6 @@ qemuMonitorJSONSetBlockThreshold(qemuMonitor *mon, unsigned long long threshold) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -virJSONValue * -qemuMonitorJSONQueryNamedBlockNodes(qemuMonitor *mon, - bool flat) - ATTRIBUTE_NONNULL(1); - int qemuMonitorJSONSetWatchdogAction(qemuMonitor *mon, const char *action) --=20 2.36.1