@samitouri / QOSamiQemu / commits / 0d111ac47d

monitor: Remove 'monitor/hmp-target.h' header

The "monitor/hmp-target.h" header doesn't contain any target-specific declarations anymore. Merge it with "monitor/hmp.h", its target-agnostic counterpart. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-Id: <20260427080738.77138-25-philmd@linaro.org>

Philippe Mathieu-Daudé committed Jan 29, 2026 at 14:18 UTC 0d111ac47d9f80d5fba519ca512503d1ddf0eb06
19 files changed +12 -59
MAINTAINERS
-1
@@ -3415,7 +3415,6 @@ F: hmp.h
3415 F: hmp-commands*.hx
3416 F: include/monitor/hmp.h
3417 F: include/monitor/hmp-completion.h
3418 -F: include/monitor/hmp-target.h
3418 F: tests/qtest/test-hmp.c
3419 F: include/qemu/qemu-print.h
3420 F: util/qemu-print.c
hw/i386/sgx-stub.c
-1
@@ -1,7 +1,6 @@
1 #include "qemu/osdep.h"
2 #include "monitor/monitor.h"
3 #include "monitor/hmp.h"
4 -#include "monitor/hmp-target.h"
4 #include "hw/i386/pc.h"
5 #include "hw/i386/sgx-epc.h"
6 #include "qapi/qapi-commands-misc-i386.h"
hw/i386/sgx.c
-1
@@ -17,7 +17,6 @@
17 #include "monitor/qdev.h"
18 #include "monitor/monitor.h"
19 #include "monitor/hmp.h"
20 -#include "monitor/hmp-target.h"
20 #include "qapi/error.h"
21 #include "qemu/error-report.h"
22 #include "qapi/qapi-commands-misc-i386.h"
include/monitor/hmp-target.h deleted
-41
@@ -1,41 +0,0 @@
1 -/*
2 - * QEMU monitor
3 - *
4 - * Copyright (c) 2003-2004 Fabrice Bellard
5 - *
6 - * Permission is hereby granted, free of charge, to any person obtaining a copy
7 - * of this software and associated documentation files (the "Software"), to deal
8 - * in the Software without restriction, including without limitation the rights
9 - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 - * copies of the Software, and to permit persons to whom the Software is
11 - * furnished to do so, subject to the following conditions:
12 - *
13 - * The above copyright notice and this permission notice shall be included in
14 - * all copies or substantial portions of the Software.
15 - *
16 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 - * THE SOFTWARE.
23 - */
24 -
25 -#ifndef MONITOR_HMP_TARGET_H
26 -#define MONITOR_HMP_TARGET_H
27 -
28 -typedef struct MonitorDef MonitorDef;
29 -
30 -struct MonitorDef {
31 - const char *name;
32 - int offset;
33 - int64_t (*get_value)(Monitor *mon, const MonitorDef *md, int offset);
34 -};
35 -
36 -const MonitorDef *target_monitor_defs(void);
37 -
38 -CPUArchState *mon_get_cpu_env(Monitor *mon);
39 -CPUState *mon_get_cpu(Monitor *mon);
40 -
41 -#endif /* MONITOR_HMP_TARGET_H */
include/monitor/hmp.h
+11
@@ -24,6 +24,17 @@
24 g_assert_not_reached(); \
25 }
26
27 +typedef struct MonitorDef {
28 + const char *name;
29 + int offset;
30 + int64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int offset);
31 +} MonitorDef;
32 +
33 +const MonitorDef *target_monitor_defs(void);
34 +
35 +CPUArchState *mon_get_cpu_env(Monitor *mon);
36 +CPUState *mon_get_cpu(Monitor *mon);
37 +
38 bool hmp_handle_error(Monitor *mon, Error *err);
39 void hmp_help_cmd(Monitor *mon, const char *name);
40 strList *hmp_split_at_comma(const char *str);
monitor/hmp-cmds.c
-1
@@ -22,7 +22,6 @@
22 #include "monitor/hmp.h"
23 #include "qemu/help_option.h"
24 #include "monitor/hmp.h"
25 -#include "monitor/hmp-target.h"
25 #include "monitor/monitor-internal.h"
26 #include "qapi/error.h"
27 #include "qapi/qapi-commands-control.h"
monitor/hmp-target.c
-1
@@ -28,7 +28,6 @@
28 #include "monitor/qdev.h"
29 #include "net/slirp.h"
30 #include "system/device_tree.h"
31 -#include "monitor/hmp-target.h"
31 #include "monitor/hmp.h"
32 #include "monitor/hmp-completion.h"
33 #include "block/block-hmp-cmds.h"
monitor/hmp.c
-1
@@ -28,7 +28,6 @@
28 #include "hw/core/sysemu-cpu-ops.h"
29 #include "monitor-internal.h"
30 #include "monitor/hmp.h"
31 -#include "monitor/hmp-target.h"
31 #include "qobject/qdict.h"
32 #include "qobject/qnum.h"
33 #include "qemu/bswap.h"
stubs/target-monitor-defs.c
+1 -1
@@ -1,5 +1,5 @@
1 #include "qemu/osdep.h"
2 -#include "monitor/hmp-target.h"
2 +#include "monitor/hmp.h"
3
4 const MonitorDef *target_monitor_defs(void)
5 {
target/i386/cpu-apic.c
-1
@@ -11,7 +11,6 @@
11 #include "qapi/error.h"
12 #include "monitor/monitor.h"
13 #include "monitor/hmp.h"
14 -#include "monitor/hmp-target.h"
14 #include "system/hw_accel.h"
15 #include "system/kvm.h"
16 #include "system/xen.h"
target/i386/monitor.c
-1
@@ -25,7 +25,6 @@
25 #include "qemu/osdep.h"
26 #include "cpu.h"
27 #include "monitor/monitor.h"
28 -#include "monitor/hmp-target.h"
28 #include "monitor/hmp.h"
29 #include "qobject/qdict.h"
30 #include "qapi/error.h"
target/i386/sev-system-stub.c
-1
@@ -14,7 +14,6 @@
14 #include "qemu/osdep.h"
15 #include "monitor/monitor.h"
16 #include "monitor/hmp.h"
17 -#include "monitor/hmp-target.h"
17 #include "qapi/error.h"
18 #include "sev.h"
19
target/i386/sev.c
-1
@@ -40,7 +40,6 @@
40 #include "qom/object.h"
41 #include "monitor/monitor.h"
42 #include "monitor/hmp.h"
43 -#include "monitor/hmp-target.h"
43 #include "qapi/qapi-commands-misc-i386.h"
44 #include "confidential-guest.h"
45 #include "hw/i386/pc.h"
target/m68k/monitor.c
-1
@@ -8,7 +8,6 @@
8 #include "qemu/osdep.h"
9 #include "cpu.h"
10 #include "monitor/hmp.h"
11 -#include "monitor/hmp-target.h"
11 #include "monitor/monitor.h"
12
13 void hmp_info_tlb(Monitor *mon, const QDict *qdict)
target/ppc/monitor.c
-2
@@ -7,9 +7,7 @@
7 */
8
9 #include "qemu/osdep.h"
10 -#include "qemu/ctype.h"
10 #include "monitor/monitor.h"
12 -#include "monitor/hmp-target.h"
11 #include "monitor/hmp.h"
12 #include "cpu.h"
13
target/riscv/monitor.c
-1
@@ -25,7 +25,6 @@
25 #include "cpu_bits.h"
26 #include "monitor/monitor.h"
27 #include "monitor/hmp.h"
28 -#include "monitor/hmp-target.h"
28 #include "system/memory.h"
29 #include "internals.h"
30
target/sh4/monitor.c
-1
@@ -24,7 +24,6 @@
24 #include "qemu/osdep.h"
25 #include "cpu.h"
26 #include "monitor/monitor.h"
27 -#include "monitor/hmp-target.h"
27 #include "monitor/hmp.h"
28
29 static void print_tlb(Monitor *mon, int idx, tlb_t *tlb)
target/sparc/monitor.c
-1
@@ -24,7 +24,6 @@
24 #include "qemu/osdep.h"
25 #include "cpu.h"
26 #include "monitor/monitor.h"
27 -#include "monitor/hmp-target.h"
27 #include "monitor/hmp.h"
28
29
target/xtensa/monitor.c
-1
@@ -24,7 +24,6 @@
24 #include "qemu/osdep.h"
25 #include "cpu.h"
26 #include "monitor/monitor.h"
27 -#include "monitor/hmp-target.h"
27 #include "monitor/hmp.h"
28
29 void hmp_info_tlb(Monitor *mon, const QDict *qdict)