mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2017-02-22' into staging
QAPI patches for 2017-02-22 # gpg: Signature made Wed 22 Feb 2017 19:12:27 GMT # gpg: using RSA key 0x3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qapi-2017-02-22: block: Don't bother asserting type of output visitor's output monitor: Clean up handle_hmp_command() a bit tests: Don't check qobject_type() before qobject_to_qbool() tests: Don't check qobject_type() before qobject_to_qfloat() tests: Don't check qobject_type() before qobject_to_qint() tests: Don't check qobject_type() before qobject_to_qstring() tests: Don't check qobject_type() before qobject_to_qlist() Don't check qobject_type() before qobject_to_qdict() test-qmp-event: Simplify and tighten event_test_emit() libqtest: Clean up qmp_response() a bit check-qjson: Simplify around compare_litqobj_to_qobj() check-qdict: Tighten qdict_crumple_test_recursive() some check-qdict: Simplify qdict_crumple_test_recursive() qdict: Make qdict_get_qlist() safe like qdict_get_qdict() net: Flatten simple union NetLegacyOptions numa: Flatten simple union NumaOptions Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
13
monitor.c
13
monitor.c
@@ -3712,12 +3712,12 @@ static QDict *qmp_check_input_obj(QObject *input_obj, Error **errp)
|
||||
int has_exec_key = 0;
|
||||
QDict *input_dict;
|
||||
|
||||
if (qobject_type(input_obj) != QTYPE_QDICT) {
|
||||
input_dict = qobject_to_qdict(input_obj);
|
||||
if (!input_dict) {
|
||||
error_setg(errp, QERR_QMP_BAD_INPUT_OBJECT, "object");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
input_dict = qobject_to_qdict(input_obj);
|
||||
|
||||
for (ent = qdict_first(input_dict); ent; ent = qdict_next(input_dict, ent)){
|
||||
const char *arg_name = qdict_entry_key(ent);
|
||||
@@ -3761,10 +3761,11 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
|
||||
Error *err = NULL;
|
||||
|
||||
req = json_parser_parse_err(tokens, NULL, &err);
|
||||
if (err || !req || qobject_type(req) != QTYPE_QDICT) {
|
||||
if (!err) {
|
||||
error_setg(&err, QERR_JSON_PARSING);
|
||||
}
|
||||
if (!req && !err) {
|
||||
/* json_parser_parse_err() sucks: can fail without setting @err */
|
||||
error_setg(&err, QERR_JSON_PARSING);
|
||||
}
|
||||
if (err) {
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user