提交 910f738b 编写于 作者: M Markus Armbruster

qapi: Improve a QObject input visitor error message

The QObject input visitor has three error message formats:

* Parameter '%s' is missing
* "Invalid parameter type for '%s', expected: %s"
* "QMP input object member '%s' is unexpected"

The '%s' are member names (or "null", but I'll fix that later).

The last error message calls the thing "QMP input object member"
instead of "parameter".  Misleading when the visitor is used on
QObjects that don't come from QMP.  Change it to "Parameter '%s' is
unexpected".
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Message-Id: <1488544368-30622-12-git-send-email-armbru@redhat.com>
上级 99fb0c53
......@@ -140,8 +140,7 @@ static void qobject_input_check_struct(Visitor *v, Error **errp)
g_hash_table_iter_init(&iter, top_ht);
if (g_hash_table_iter_next(&iter, (void **)&key, NULL)) {
error_setg(errp, "QMP input object member '%s' is unexpected",
key);
error_setg(errp, "Parameter '%s' is unexpected", key);
}
}
}
......
......@@ -213,7 +213,7 @@ static void test_qga_invalid_args(gconstpointer fix)
desc = qdict_get_try_str(error, "desc");
g_assert_cmpstr(class, ==, "GenericError");
g_assert_cmpstr(desc, ==, "QMP input object member 'foo' is unexpected");
g_assert_cmpstr(desc, ==, "Parameter 'foo' is unexpected");
QDECREF(ret);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册