monitor: Make 'info via' a generic command
In order to build hmp-commands-info.hx once we need to stop using device target-specific check. Use the generic pattern to make the command available on all targets, providing a stub with kind error message when the device is not available. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20260427080738.77138-9-philmd@linaro.org>
Philippe Mathieu-Daudé committed
Apr 10, 2026 at 15:47 UTC
ac86354547bdb75152d4d1e81332358000d2e036
4 files changed
+18
-3
MAINTAINERS
+1
-1
@@ -1566,7 +1566,7 @@ F: hw/ppc/mac_newworld.c
1566
F: hw/pci-host/uninorth.c
1567
F: hw/pci-bridge/dec.[hc]
1568
F: hw/misc/macio/
1569
-F: hw/misc/mos6522.c
1569
+F: hw/misc/mos6522*.c
1570
F: hw/nvram/mac_nvram.c
1571
F: hw/ppc/fw_cfg.c
1572
F: hw/input/adb*
hmp-commands-info.hx
-2
@@ -878,7 +878,6 @@ SRST
878
Show intel SGX information.
879
ERST
880
881
-#if defined(CONFIG_MOS6522)
881
{
882
.name = "via",
883
.args_type = "",
@@ -886,7 +885,6 @@ ERST
885
.help = "show guest mos6522 VIA devices",
886
.cmd = hmp_info_via,
887
},
889
-#endif
888
889
SRST
890
``info via``
hw/misc/meson.build
+1
@@ -20,6 +20,7 @@ system_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m_ras.c'))
20
21
# Mac devices
22
system_ss.add(when: 'CONFIG_MOS6522', if_true: files('mos6522.c'))
23
+stub_ss.add(files('mos6522-stub.c'))
24
system_ss.add(when: 'CONFIG_DJMEMC', if_true: files('djmemc.c'))
25
system_ss.add(when: 'CONFIG_IOSB', if_true: files('iosb.c'))
26
hw/misc/mos6522-stub.c
new
+16
@@ -0,0 +1,16 @@
1
+/*
2
+ * QEMU MOS6522 VIA stubs
3
+ *
4
+ * Copyright (c) Linaro
5
+ *
6
+ * SPDX-License-Identifier: GPL-2.0-or-later
7
+ */
8
+
9
+#include "qemu/osdep.h"
10
+#include "monitor/monitor.h"
11
+#include "monitor/hmp.h"
12
+
13
+void hmp_info_via(Monitor *mon, const QDict *qdict)
14
+{
15
+ monitor_printf(mon, "MOS6522 VIA is not available in this QEMU\n");
16
+}