Skip to content

Commit da9e26d

Browse files
committed
[temporary patch from upstream PR] hw/riscv: Fix type conflict of GLib function pointers
This patch is temporary patch cherry-picked from the upstream PR. This should be removed once this is available on the upstream. > qtest_set_command_cb passed to g_once should match GThreadFunc, > which it does not. But using g_once is actually unnecessary, > because the function is called by riscv_harts_realize() under > the Big QEMU Lock. > > Reported-by: Kohei Tokunaga <[email protected]> > Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 54ff302 commit da9e26d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

hw/riscv/riscv_hart.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,11 @@ static bool csr_qtest_callback(CharBackend *chr, gchar **words)
104104

105105
static void riscv_cpu_register_csr_qtest_callback(void)
106106
{
107-
static GOnce once;
108-
g_once(&once, (GThreadFunc)qtest_set_command_cb, csr_qtest_callback);
107+
static bool first = true;
108+
if (first) {
109+
first = false;
110+
qtest_set_command_cb(csr_qtest_callback);
111+
}
109112
}
110113
#endif
111114

0 commit comments

Comments
 (0)