aboutsummaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2023-01-24 13:19:45 +0100
committerMarkus Armbruster <armbru@redhat.com>2023-02-04 07:56:54 +0100
commit9d2b5f2ce4c7913406f7d17aafcf2f71757e49d8 (patch)
tree18b36316696946ee45af95c2e631c7925f8d0182 /monitor
parente6e108d138635b33f0ef48058c7aafa58484556b (diff)
monitor: Loosen coupling between misc.c and monitor.c slightly
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-32-armbru@redhat.com>
Diffstat (limited to 'monitor')
-rw-r--r--monitor/misc.c8
-rw-r--r--monitor/monitor.c2
2 files changed, 2 insertions, 8 deletions
diff --git a/monitor/misc.c b/monitor/misc.c
index 9ddf32da97..99317a8ff4 100644
--- a/monitor/misc.c
+++ b/monitor/misc.c
@@ -135,7 +135,7 @@ compare_mon_cmd(const void *a, const void *b)
((const HMPCommand *)b)->name);
}
-static void sortcmdlist(void)
+static void __attribute__((__constructor__)) sortcmdlist(void)
{
qsort(hmp_cmds, ARRAY_SIZE(hmp_cmds) - 1,
sizeof(*hmp_cmds),
@@ -176,9 +176,3 @@ void monitor_register_hmp_info_hrt(const char *name,
}
g_assert_not_reached();
}
-
-void monitor_init_globals(void)
-{
- monitor_init_globals_core();
- sortcmdlist();
-}
diff --git a/monitor/monitor.c b/monitor/monitor.c
index e1d5002adf..8dc96f6af9 100644
--- a/monitor/monitor.c
+++ b/monitor/monitor.c
@@ -720,7 +720,7 @@ static void monitor_qapi_event_init(void)
qapi_event_throttle_equal);
}
-void monitor_init_globals_core(void)
+void monitor_init_globals(void)
{
monitor_qapi_event_init();
qemu_mutex_init(&monitor_lock);