diff options
author | Peter Xu <peterx@redhat.com> | 2018-08-15 21:37:35 +0800 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2018-08-28 18:03:07 +0200 |
commit | 3d7a1c44e2b23079485c0cd21ca2db04f886ec13 (patch) | |
tree | 38fde0c38aae6ed8e709fcc6c3b3cbf5fbbc839c /monitor.c | |
parent | 19b599f7664b2ebfd0f405fb79c14dd241557452 (diff) |
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>
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -4631,15 +4631,9 @@ static void monitor_qmp_setup_handlers_bh(void *opaque) Monitor *mon = opaque; GMainContext *context; - if (mon->use_io_thread) { - /* Use @mon_iothread context */ - context = monitor_get_io_context(); - assert(context); - } else { - /* Use default main loop context */ - context = NULL; - } - + assert(mon->use_io_thread); + context = monitor_get_io_context(); + assert(context); qemu_chr_fe_set_handlers(&mon->chr, monitor_can_read, monitor_qmp_read, monitor_qmp_event, NULL, mon, context, true); monitor_list_append(mon); |