From patchwork Mon Jun 10 15:07:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 803012 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1990670wro; Mon, 10 Jun 2024 08:09:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXSemTZMO56jHvqXFzQX3CBOb1HEAMXrPkbeGnhcsjdV6V5DU2GrI6S5Gk2Kkxj3NyyaBzGnATezlLG1e2HODsw X-Google-Smtp-Source: AGHT+IFpHZ/w+GNA4sB9q3Op0p2Ddemfx8CVOnhqiyLm43kQXxZ7opWMva3G5e6L0WGTVbNjaRJZ X-Received: by 2002:a81:6fd5:0:b0:627:e281:6763 with SMTP id 00721157ae682-62cd55c59ffmr97628107b3.14.1718032143802; Mon, 10 Jun 2024 08:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718032143; cv=none; d=google.com; s=arc-20160816; b=wFpJ4X6yAw4uekBpLyn3H8fruFvmMQRfolFHLO9kyKW3ARo7QIRuP+nUyRtpAgZs9f remHe5EhuJR9+irI3eL77P+egJnVWt0UQgnzDkhS3WLB9rKYbgQ64ZFWLdYOkTEPqFob 8Xx06e0iQuYMGNuNoFgWr4V/ut0Pkd9WGICp8P6P8ciXFZs3vFrRm+48Eh/VNfyn7YAj UH7lrS/9IEkZzDARuW+RABps0/leFQhsvzOLxWUhwjZ3x2CKJNvW7NA1mbP0VxsvgjOY bmkaFIBriWXmWPMES/STBWSNYhG7ez+6t72lp8riMn/x2fY7EL4uYnNi/vgb3fSuuPe3 etug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yXk0bDQ1yYJpJgY5lHESnxmo/mUAUI8vWA756v/ff84=; fh=F+shdip0qMpnO2Cf3HxyQ55mbne7FLl0Qz+Sn1N9G4s=; b=cdU4tOC8o87CxTEAqDtKGhRLMt107ltnR/EKj+Jbh6/UrnBlZTlTS/JA774k//SQT6 ZGmCjSFlJzkG0ZXrVK5jiunBaP3H0bkfgg7g6RE3hhD/6N15opF+DeXC64nnROPfUrrt mtaTq1JZYKBXszyxn2pWv9iK894CrkX4HCxpTsa9tCk7/nnEG6vidSJWb75ta5ybvWyj JMEtglUqWU0Ss0VsB2I6H2ZtXjIOFQflNDDzNzM8LRGRjeeRFWneFZ5Jo7kYxxtEbIG8 yQTp3G5dCOkk6G0AW34Wu7ZdOr/+bTmBESwzkWfpkhl7r2LFIZeHRMXo7vmK8EOCOmCB VEsg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IP+419bC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a1e0cc1a2514c-80b88af2422si820571241.129.2024.06.10.08.09.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jun 2024 08:09:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IP+419bC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sGgd9-0005fU-D8; Mon, 10 Jun 2024 11:08:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGgd7-0005eL-Ij for qemu-devel@nongnu.org; Mon, 10 Jun 2024 11:08:17 -0400 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGgd5-0006Yw-SA for qemu-devel@nongnu.org; Mon, 10 Jun 2024 11:08:17 -0400 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2ebeefb9b56so506341fa.0 for ; Mon, 10 Jun 2024 08:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718032093; x=1718636893; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yXk0bDQ1yYJpJgY5lHESnxmo/mUAUI8vWA756v/ff84=; b=IP+419bCWvT4ByeHNw8/QBFSAJa4YP58FXPo0cm9KILSNBFSWKzDgHIQNnKDYroR84 Z/J0zl0A0LQfbkzl00eELfN7E/JF3ZwHtclLGTSJAt5TwpkTk4xY9bqhjB5GAyfyJ+c1 sfJsqplzHXyABFWZ1B5OmHra+RC/kqB1RaspNJnUh7q5DPzZZkrOybcnwvSOKfr/qI+S KdCgOT9yNGj8YcGEzrtywQ47CQKIisFRAAnAnZtumv43d55OaVbc3NaXunAn49R7m23n UtW5q3JVTUFd0wGJt4m4OKt5fR1g6O2d1PABPHOEjyREfnXb3Pcf3u8v/CNKzsTJI+OK 4ivw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718032093; x=1718636893; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yXk0bDQ1yYJpJgY5lHESnxmo/mUAUI8vWA756v/ff84=; b=mzR6omabrGBaOoG1ihxAq1Da0dwA6vVNYqHuecAU96Fzwot7oKivFMMXcE1rxWTTt/ 7D6x84PO5pH6QapXJR/1ITo5w6DtlJGbR2+zPUXZZXLWQpwnKMTeumb0WaIzuEyM9HlN DtnVV8oBQsSDRPEZr3F72z1OxfepfxBENoNkBb4JFJnpuQvfoPzIfYoF0lAIC1EgMh+b gMpjumYV6MZ8EkwDT4CrmJJLpqLk0FhWlAjA1b9uF45Nh5FS2oUlWPQ3pEpTlDYiZXCZ ASOVEWLlPwxyiQpgnX0pGOv29W94vkjdjM/YGqw/iXMEekRxy++3ETNWXBjEvgmrPPVp 69Pw== X-Gm-Message-State: AOJu0YwOlqDbE2mYz5YpFvRWovqXFAUT/7jjtdznXA5GjDlls5s/Rpbh BVMgeTKo1QaSB1JM149EC0ve0sGkZlRxRlqpucdWHnHuGbQ+Wr12unCB2uF5WF8LOQ0f6cyOq+Y L X-Received: by 2002:a05:651c:b06:b0:2eb:f029:7142 with SMTP id 38308e7fff4ca-2ebf029716emr2631901fa.15.1718032093424; Mon, 10 Jun 2024 08:08:13 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42196386d13sm47450965e9.12.2024.06.10.08.08.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Jun 2024 08:08:12 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Markus Armbruster , Mark Cave-Ayland , =?utf-8?q?Daniel_P_=2E_Be?= =?utf-8?q?rrang=C3=A9?= , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/2] hw/misc/mos6522: Do not open-code hmp_info_human_readable_text() Date: Mon, 10 Jun 2024 17:07:58 +0200 Message-ID: <20240610150758.2827-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240610150758.2827-1-philmd@linaro.org> References: <20240610150758.2827-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Register the command 'info via' using HMPCommand::cmd_info_hrt(), so it is processed using the generic hmp_info_human_readable_text(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé --- include/hw/misc/mos6522.h | 2 -- include/monitor/hmp-target.h | 1 - hw/misc/mos6522.c | 13 ------------- hmp-commands-info.hx | 2 +- 4 files changed, 1 insertion(+), 17 deletions(-) diff --git a/include/hw/misc/mos6522.h b/include/hw/misc/mos6522.h index fba45668ab..a54fe063ac 100644 --- a/include/hw/misc/mos6522.h +++ b/include/hw/misc/mos6522.h @@ -172,6 +172,4 @@ extern const VMStateDescription vmstate_mos6522; uint64_t mos6522_read(void *opaque, hwaddr addr, unsigned size); void mos6522_write(void *opaque, hwaddr addr, uint64_t val, unsigned size); -void hmp_info_via(Monitor *mon, const QDict *qdict); - #endif /* MOS6522_H */ diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index b679aaebbf..9b46fec84a 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -53,7 +53,6 @@ void hmp_mce(Monitor *mon, const QDict *qdict); void hmp_info_local_apic(Monitor *mon, const QDict *qdict); void hmp_info_sev(Monitor *mon, const QDict *qdict); void hmp_info_sgx(Monitor *mon, const QDict *qdict); -void hmp_info_via(Monitor *mon, const QDict *qdict); void hmp_memory_dump(Monitor *mon, const QDict *qdict); void hmp_physical_memory_dump(Monitor *mon, const QDict *qdict); void hmp_info_registers(Monitor *mon, const QDict *qdict); diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index b1bb7f54f0..afa343dd27 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.c @@ -29,8 +29,6 @@ #include "hw/misc/mos6522.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" -#include "monitor/monitor.h" -#include "monitor/hmp.h" #include "qapi/qapi-commands-machine.h" #include "qapi/type-helpers.h" #include "qemu/timer.h" @@ -587,17 +585,6 @@ HumanReadableText *qmp_x_query_mos6522_devices(Error **errp) return human_readable_text_from_str(buf); } -void hmp_info_via(Monitor *mon, const QDict *qdict) -{ - Error *err = NULL; - g_autoptr(HumanReadableText) info = qmp_x_query_mos6522_devices(&err); - - if (hmp_handle_error(mon, err)) { - return; - } - monitor_puts(mon, info->human_readable_text); -} - static const MemoryRegionOps mos6522_ops = { .read = mos6522_read, .write = mos6522_write, diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index cfd4ad5651..a24c217d89 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -873,7 +873,7 @@ ERST .args_type = "", .params = "", .help = "show guest mos6522 VIA devices", - .cmd = hmp_info_via, + .cmd_info_hrt = qmp_x_query_mos6522_devices, }, #endif