mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
qapi: Enforce command naming rules
Command names should be lower-case. Enforce this. Fix the fixable offenders (all in tests/), and add the remainder to pragma command-name-exceptions. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-25-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
e744708a77
commit
05ebf841ef
8 changed files with 62 additions and 31 deletions
|
@ -13,7 +13,7 @@
|
|||
|
||||
static QmpCommandList qmp_commands;
|
||||
|
||||
UserDefThree *qmp_TestCmdReturnDefThree(Error **errp)
|
||||
UserDefThree *qmp_test_cmd_return_def_three(Error **errp)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ static void test_dispatch_cmd(void)
|
|||
|
||||
ret = qobject_to(QDict,
|
||||
do_qmp_dispatch(false,
|
||||
"{ 'execute': 'user_def_cmd' }"));
|
||||
"{ 'execute': 'user-def-cmd' }"));
|
||||
assert(ret && qdict_size(ret) == 0);
|
||||
qobject_unref(ret);
|
||||
}
|
||||
|
@ -220,11 +220,11 @@ static void test_dispatch_cmd_failure(void)
|
|||
{
|
||||
/* missing arguments */
|
||||
do_qmp_dispatch_error(false, ERROR_CLASS_GENERIC_ERROR,
|
||||
"{ 'execute': 'user_def_cmd2' }");
|
||||
"{ 'execute': 'user-def-cmd2' }");
|
||||
|
||||
/* extra arguments */
|
||||
do_qmp_dispatch_error(false, ERROR_CLASS_GENERIC_ERROR,
|
||||
"{ 'execute': 'user_def_cmd',"
|
||||
"{ 'execute': 'user-def-cmd',"
|
||||
" 'arguments': { 'a': 66 } }");
|
||||
}
|
||||
|
||||
|
@ -248,7 +248,7 @@ static void test_dispatch_cmd_io(void)
|
|||
int64_t val;
|
||||
|
||||
ret = qobject_to(QDict, do_qmp_dispatch(false,
|
||||
"{ 'execute': 'user_def_cmd2', 'arguments': {"
|
||||
"{ 'execute': 'user-def-cmd2', 'arguments': {"
|
||||
" 'ud1a': { 'integer': 42, 'string': 'hello' },"
|
||||
" 'ud1b': { 'integer': 422, 'string': 'hello2' } } }"));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue