@samitouri / QOSamiQemu / commits / 88684b482f

monitor: Forward-declare the MonitorDef type

Rather than having core header forced to include "monitor/hmp.h" to get the MonitorDef type declaration, forward-declare it in "qemu/typedefs.h". Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20260427080738.77138-26-philmd@linaro.org>

Philippe Mathieu-Daudé committed Mar 20, 2026 at 12:10 UTC 88684b482f4078dc6e9c037e3f623f5aa6c38618
2 files changed +4 -3
include/monitor/hmp.h
+3 -3
@@ -24,11 +24,11 @@
24 g_assert_not_reached(); \
25 }
26
27 -typedef struct MonitorDef {
27 +struct MonitorDef {
28 const char *name;
29 int offset;
30 - int64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int offset);
31 -} MonitorDef;
30 + int64_t (*get_value)(Monitor *mon, const MonitorDef *md, int offset);
31 +};
32
33 const MonitorDef *target_monitor_defs(void);
34
include/qemu/typedefs.h
+1
@@ -72,6 +72,7 @@ typedef struct MemoryRegionSection MemoryRegionSection;
72 typedef struct MigrationIncomingState MigrationIncomingState;
73 typedef struct MigrationState MigrationState;
74 typedef struct Monitor Monitor;
75 +typedef struct MonitorDef MonitorDef;
76 typedef struct MSIMessage MSIMessage;
77 typedef struct NetClientState NetClientState;
78 typedef struct NetFilterState NetFilterState;