]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
monitor: simplify monitor_qmp_setup_handlers_bh
authorPeter Xu <peterx@redhat.com>
Wed, 15 Aug 2018 13:37:35 +0000 (21:37 +0800)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 28 Aug 2018 16:03:07 +0000 (18:03 +0200)
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>
monitor.c

index 021c11b1bf2af19855c02ebe25d732779cbde887..c0497766032241eeb806b30ec475234ea3da47f7 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -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);