aboutsummaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2023-05-17 17:19:03 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2023-05-25 10:18:33 +0200
commitc5d0c55f1ac402327235e4046f3921d16bc7b529 (patch)
tree75b070fc9895a055ea1301ab4e69eb70d66565e0 /monitor
parente37548ef13dcbe158662c8dc9797c15c052c3a81 (diff)
monitor: allow calling monitor_resume under mon_lock
Move monitor_resume()'s call to readline_show_prompt() outside the potentially locked section. Reuse the existing monitor_accept_input() bottom half for this purpose. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'monitor')
-rw-r--r--monitor/monitor.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/monitor/monitor.c b/monitor/monitor.c
index 4b11bca2a2..7080d2da8e 100644
--- a/monitor/monitor.c
+++ b/monitor/monitor.c
@@ -567,6 +567,12 @@ static void monitor_accept_input(void *opaque)
{
Monitor *mon = opaque;
+ if (!monitor_is_qmp(mon)) {
+ MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common);
+ assert(hmp_mon->rs);
+ readline_show_prompt(hmp_mon->rs);
+ }
+
qemu_chr_fe_accept_input(&mon->chr);
}
@@ -585,12 +591,6 @@ void monitor_resume(Monitor *mon)
ctx = qemu_get_aio_context();
}
- if (!monitor_is_qmp(mon)) {
- MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common);
- assert(hmp_mon->rs);
- readline_show_prompt(hmp_mon->rs);
- }
-
aio_bh_schedule_oneshot(ctx, monitor_accept_input, mon);
}