From 41725fa7eda1d97576fc8c79b58d04a61629f40e Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Mon, 5 Oct 2020 17:58:47 +0200 Subject: qmp: Call monitor_set_cur() only in qmp_dispatch() The correct way to set the current monitor for a coroutine handler will be different than for a blocking handler, so monitor_set_cur() needs to be called in qmp_dispatch(). Signed-off-by: Kevin Wolf Message-Id: <20201005155855.256490-7-kwolf@redhat.com> Reviewed-by: Markus Armbruster Reviewed-by: Stefan Hajnoczi Signed-off-by: Markus Armbruster --- monitor/qmp.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'monitor') diff --git a/monitor/qmp.c b/monitor/qmp.c index 8469970c69..e746b3575d 100644 --- a/monitor/qmp.c +++ b/monitor/qmp.c @@ -135,16 +135,11 @@ static void monitor_qmp_respond(MonitorQMP *mon, QDict *rsp) static void monitor_qmp_dispatch(MonitorQMP *mon, QObject *req) { - Monitor *old_mon; QDict *rsp; QDict *error; - old_mon = monitor_set_cur(&mon->common); - assert(old_mon == NULL); - - rsp = qmp_dispatch(mon->commands, req, qmp_oob_enabled(mon)); - - monitor_set_cur(NULL); + rsp = qmp_dispatch(mon->commands, req, qmp_oob_enabled(mon), + &mon->common); if (mon->commands == &qmp_cap_negotiation_commands) { error = qdict_get_qdict(rsp, "error"); -- cgit v1.2.3-55-g7522