From nobody Mon Nov 10 09:50:07 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555529505; cv=none; d=zoho.com; s=zohoarc; b=d4c6RqVKcQHCApLyd1Q3/+sB2GytapDLSOTBfYL2jNcp29sQQv8hvWsPFu5zAaEzGmM5YeYNqz1Sm2qTwC99/hZg/xQAR33a7EjTZyXL1T4KmS12RofkOgQcF63DuRDbzdFJcTyKXH0odMrRZXugWWzLEmzLRtx6vRrMzaI58S8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555529505; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=4xklXDmyAKoJ4SGpOoE1mNA1eIkVDGHM5Z0LoV97odE=; b=hkxIysr7bnIszwbwUiBr0YjinHuNsrIb9YnVHxYXRhhM5903W5yjiqHyzghPviflennPiAzenwEetx0i6fmKWqWMyUoJEwt3yr/bVBA4eBaBtTPjL6zY1gFzJJZvNljiGcBtdqYKe794q5X3jyCGgbyyx+XEl60eV+dmN5PwKJA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1555529505777314.597692788891; Wed, 17 Apr 2019 12:31:45 -0700 (PDT) Received: from localhost ([127.0.0.1]:58488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGqHO-00022C-HU for importer@patchew.org; Wed, 17 Apr 2019 15:31:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGq4c-00004w-JV for qemu-devel@nongnu.org; Wed, 17 Apr 2019 15:18:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGq4a-0000FW-PF for qemu-devel@nongnu.org; Wed, 17 Apr 2019 15:18:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43200) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hGq4Y-0008Qm-Rm for qemu-devel@nongnu.org; Wed, 17 Apr 2019 15:18:19 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A8DB8307E059 for ; Wed, 17 Apr 2019 19:18:10 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-116.ams2.redhat.com [10.36.116.116]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 30554608C7; Wed, 17 Apr 2019 19:18:10 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A2C6F1132783; Wed, 17 Apr 2019 21:18:05 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 17 Apr 2019 21:18:03 +0200 Message-Id: <20190417191805.28198-16-armbru@redhat.com> In-Reply-To: <20190417191805.28198-1-armbru@redhat.com> References: <20190417191805.28198-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 17 Apr 2019 19:18:10 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 15/17] monitor: Clean up how monitor_disas() funnels output to monitor X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" INIT_DISASSEMBLE_INFO() takes an fprintf()-like callback and a FILE * to pass to it. monitor_disas() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-pinning is ugly. Pass qemu_fprintf() and NULL instead. monitor_fprintf() is now unused; delete it. Signed-off-by: Markus Armbruster Reviewed-by: Dr. David Alan Gilbert --- disas.c | 3 ++- include/monitor/monitor.h | 1 - monitor.c | 11 ----------- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/disas.c b/disas.c index d9aa713a40..d15cceb863 100644 --- a/disas.c +++ b/disas.c @@ -3,6 +3,7 @@ #include "qemu-common.h" #include "disas/bfd.h" #include "elf.h" +#include "qemu/qemu-print.h" =20 #include "cpu.h" #include "disas/disas.h" @@ -609,7 +610,7 @@ void monitor_disas(Monitor *mon, CPUState *cpu, int count, i; CPUDebug s; =20 - INIT_DISASSEMBLE_INFO(s.info, (FILE *)mon, monitor_fprintf); + INIT_DISASSEMBLE_INFO(s.info, NULL, qemu_fprintf); =20 s.cpu =3D cpu; s.info.read_memory_func diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 316a168c41..86656297f1 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -31,7 +31,6 @@ int monitor_fd_param(Monitor *mon, const char *fdname, Er= ror **errp); int monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0); int monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3); -int monitor_fprintf(FILE *stream, const char *fmt, ...) GCC_FMT_ATTR(2, 3); void monitor_flush(Monitor *mon); int monitor_set_cpu(int cpu_index); int monitor_get_cpu_index(void); diff --git a/monitor.c b/monitor.c index ad6cec54a1..9b5f10b475 100644 --- a/monitor.c +++ b/monitor.c @@ -480,17 +480,6 @@ int monitor_printf(Monitor *mon, const char *fmt, ...) return ret; } =20 -int monitor_fprintf(FILE *stream, const char *fmt, ...) -{ - int ret; - - va_list ap; - va_start(ap, fmt); - ret =3D monitor_vprintf((Monitor *)stream, fmt, ap); - va_end(ap); - return ret; -} - static void qmp_send_response(Monitor *mon, const QDict *rsp) { const QObject *data =3D QOBJECT(rsp); --=20 2.17.2