mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
qmp qemu-ga: Revert change that accidentally made qemu-ga accept "id"
Commit cf869d5317
"qmp: support out-of-band (oob) execution" changed
how we check "id":
Note that in the patch I exported qmp_dispatch_check_obj() to be
used to check the request earlier, and at the same time allowed
"id" field to be there since actually we always allow that.
The part after "and" is ill-advised: it makes qemu-ga accept and
ignore "id". Revert.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180703085358.13941-10-armbru@redhat.com>
This commit is contained in:
parent
b5f8431040
commit
0fa39d0b03
3 changed files with 13 additions and 16 deletions
14
monitor.c
14
monitor.c
|
@ -4264,7 +4264,7 @@ static void monitor_qmp_bh_dispatcher(void *data)
|
|||
static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
|
||||
{
|
||||
QObject *req, *id = NULL;
|
||||
QDict *qdict = NULL;
|
||||
QDict *qdict;
|
||||
MonitorQMP *mon_qmp = container_of(parser, MonitorQMP, parser);
|
||||
Monitor *mon = container_of(mon_qmp, Monitor, qmp);
|
||||
Error *err = NULL;
|
||||
|
@ -4279,6 +4279,12 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
|
|||
goto err;
|
||||
}
|
||||
|
||||
qdict = qobject_to(QDict, req);
|
||||
if (qdict) {
|
||||
id = qobject_ref(qdict_get(qdict, "id"));
|
||||
qdict_del(qdict, "id");
|
||||
} /* else will fail qmp_dispatch() */
|
||||
|
||||
/* Check against the request in general layout */
|
||||
qdict = qmp_dispatch_check_obj(req, &err);
|
||||
if (!qdict) {
|
||||
|
@ -4290,16 +4296,12 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
|
|||
goto err;
|
||||
}
|
||||
|
||||
id = qdict_get(qdict, "id");
|
||||
|
||||
req_obj = g_new0(QMPRequest, 1);
|
||||
req_obj->mon = mon;
|
||||
req_obj->id = qobject_ref(id);
|
||||
req_obj->id = id;
|
||||
req_obj->req = req;
|
||||
req_obj->need_resume = false;
|
||||
|
||||
qdict_del(qdict, "id");
|
||||
|
||||
if (qmp_is_oob(qdict)) {
|
||||
/* Out-of-band (OOB) requests are executed directly in parser. */
|
||||
trace_monitor_qmp_cmd_out_of_band(qobject_get_try_str(req_obj->id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue