mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 15:15:46 +00:00
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 <kwolf@redhat.com> Message-Id: <20201005155855.256490-7-kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
committed by
Markus Armbruster
parent
57d3635e42
commit
41725fa7ed
@ -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");
|
||||
|
Reference in New Issue
Block a user