mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-31 05:51:53 -06:00
monitor: simplify monitor_qmp_setup_handlers_bh
When we reach monitor_qmp_setup_handlers_bh() we must be using the IOThread then, so no need to check against it any more. Instead, we assert. Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180815133747.25032-2-peterx@redhat.com> [Insufficiently useful comment dropped] Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
19b599f766
commit
3d7a1c44e2
1 changed files with 3 additions and 9 deletions
12
monitor.c
12
monitor.c
|
@ -4631,15 +4631,9 @@ static void monitor_qmp_setup_handlers_bh(void *opaque)
|
||||||
Monitor *mon = opaque;
|
Monitor *mon = opaque;
|
||||||
GMainContext *context;
|
GMainContext *context;
|
||||||
|
|
||||||
if (mon->use_io_thread) {
|
assert(mon->use_io_thread);
|
||||||
/* Use @mon_iothread context */
|
context = monitor_get_io_context();
|
||||||
context = monitor_get_io_context();
|
assert(context);
|
||||||
assert(context);
|
|
||||||
} else {
|
|
||||||
/* Use default main loop context */
|
|
||||||
context = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
qemu_chr_fe_set_handlers(&mon->chr, monitor_can_read, monitor_qmp_read,
|
qemu_chr_fe_set_handlers(&mon->chr, monitor_can_read, monitor_qmp_read,
|
||||||
monitor_qmp_event, NULL, mon, context, true);
|
monitor_qmp_event, NULL, mon, context, true);
|
||||||
monitor_list_append(mon);
|
monitor_list_append(mon);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue