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é <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Message-Id: <[email protected]> --- include/monitor/hmp.h | 6 +++--- include/qemu/typedefs.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index 357fc972885..d423f54f904 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -24,11 +24,11 @@ g_assert_not_reached(); \ } -typedef struct MonitorDef { +struct MonitorDef { const char *name; int offset; - int64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int offset); -} MonitorDef; + int64_t (*get_value)(Monitor *mon, const MonitorDef *md, int offset); +}; const MonitorDef *target_monitor_defs(void); diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 416a8c9acea..07f2ae7c9f1 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -72,6 +72,7 @@ typedef struct MemoryRegionSection MemoryRegionSection; typedef struct MigrationIncomingState MigrationIncomingState; typedef struct MigrationState MigrationState; typedef struct Monitor Monitor; +typedef struct MonitorDef MonitorDef; typedef struct MSIMessage MSIMessage; typedef struct NetClientState NetClientState; typedef struct NetFilterState NetFilterState; -- 2.53.0
