mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-18 05:28:36 -07: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:
parent
57d3635e42
commit
41725fa7ed
6 changed files with 20 additions and 13 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue