提交 7fad30f0 编写于 作者: M Markus Armbruster

qapi: Rename qmp_marshal_input_FOO() to qmp_marshal_FOO()

These functions marshal both input and output.
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
Message-Id: <1442401589-24189-17-git-send-email-armbru@redhat.com>
上级 f1538019
...@@ -744,7 +744,7 @@ Example: ...@@ -744,7 +744,7 @@ Example:
qapi_dealloc_visitor_cleanup(md); qapi_dealloc_visitor_cleanup(md);
} }
static void qmp_marshal_input_my_command(QDict *args, QObject **ret, Error **errp) static void qmp_marshal_my_command(QDict *args, QObject **ret, Error **errp)
{ {
Error *local_err = NULL; Error *local_err = NULL;
UserDefOne *retval; UserDefOne *retval;
...@@ -777,7 +777,7 @@ Example: ...@@ -777,7 +777,7 @@ Example:
static void qmp_init_marshal(void) static void qmp_init_marshal(void)
{ {
qmp_register_command("my-command", qmp_marshal_input_my_command, QCO_NO_OPTIONS); qmp_register_command("my-command", qmp_marshal_my_command, QCO_NO_OPTIONS);
} }
qapi_init(qmp_init_marshal); qapi_init(qmp_init_marshal);
......
...@@ -127,7 +127,7 @@ following at the bottom: ...@@ -127,7 +127,7 @@ following at the bottom:
{ {
.name = "hello-world", .name = "hello-world",
.args_type = "", .args_type = "",
.mhandler.cmd_new = qmp_marshal_input_hello_world, .mhandler.cmd_new = qmp_marshal_hello_world,
}, },
You're done. Now build qemu, run it as suggested in the "Testing" section, You're done. Now build qemu, run it as suggested in the "Testing" section,
...@@ -179,7 +179,7 @@ The last step is to update the qmp-commands.hx file: ...@@ -179,7 +179,7 @@ The last step is to update the qmp-commands.hx file:
{ {
.name = "hello-world", .name = "hello-world",
.args_type = "message:s?", .args_type = "message:s?",
.mhandler.cmd_new = qmp_marshal_input_hello_world, .mhandler.cmd_new = qmp_marshal_hello_world,
}, },
Notice that the "args_type" member got our "message" argument. The character Notice that the "args_type" member got our "message" argument. The character
...@@ -461,7 +461,7 @@ The last step is to add the correspoding entry in the qmp-commands.hx file: ...@@ -461,7 +461,7 @@ The last step is to add the correspoding entry in the qmp-commands.hx file:
{ {
.name = "query-alarm-clock", .name = "query-alarm-clock",
.args_type = "", .args_type = "",
.mhandler.cmd_new = qmp_marshal_input_query_alarm_clock, .mhandler.cmd_new = qmp_marshal_query_alarm_clock,
}, },
Time to test the new command. Build qemu, run it as described in the "Testing" Time to test the new command. Build qemu, run it as described in the "Testing"
...@@ -607,7 +607,7 @@ To test this you have to add the corresponding qmp-commands.hx entry: ...@@ -607,7 +607,7 @@ To test this you have to add the corresponding qmp-commands.hx entry:
{ {
.name = "query-alarm-methods", .name = "query-alarm-methods",
.args_type = "", .args_type = "",
.mhandler.cmd_new = qmp_marshal_input_query_alarm_methods, .mhandler.cmd_new = qmp_marshal_query_alarm_methods,
}, },
Now Build qemu, run it as explained in the "Testing" section and try our new Now Build qemu, run it as explained in the "Testing" section and try our new
......
...@@ -3912,7 +3912,7 @@ static QObject *get_qmp_greeting(void) ...@@ -3912,7 +3912,7 @@ static QObject *get_qmp_greeting(void)
{ {
QObject *ver = NULL; QObject *ver = NULL;
qmp_marshal_input_query_version(NULL, &ver, NULL); qmp_marshal_query_version(NULL, &ver, NULL);
return qobject_from_jsonf("{'QMP':{'version': %p,'capabilities': []}}",ver); return qobject_from_jsonf("{'QMP':{'version': %p,'capabilities': []}}",ver);
} }
......
此差异已折叠。
...@@ -157,9 +157,9 @@ VncInfo2List *qmp_query_vnc_servers(Error **errp) ...@@ -157,9 +157,9 @@ VncInfo2List *qmp_query_vnc_servers(Error **errp)
* #ifdef CONFIG_SPICE. Necessary for an accurate query-commands * #ifdef CONFIG_SPICE. Necessary for an accurate query-commands
* result. However, the QAPI schema is blissfully unaware of that, * result. However, the QAPI schema is blissfully unaware of that,
* and the QAPI code generator happily generates a dead * and the QAPI code generator happily generates a dead
* qmp_marshal_input_query_spice() that calls qmp_query_spice(). * qmp_marshal_query_spice() that calls qmp_query_spice(). Provide it
* Provide it one, or else linking fails. * one, or else linking fails. FIXME Educate the QAPI schema on
* FIXME Educate the QAPI schema on CONFIG_SPICE. * CONFIG_SPICE.
*/ */
SpiceInfo *qmp_query_spice(Error **errp) SpiceInfo *qmp_query_spice(Error **errp)
{ {
......
...@@ -204,7 +204,7 @@ out: ...@@ -204,7 +204,7 @@ out:
def gen_marshal_proto(name): def gen_marshal_proto(name):
ret = 'void qmp_marshal_input_%s(QDict *args, QObject **ret, Error **errp)' % c_name(name) ret = 'void qmp_marshal_%s(QDict *args, QObject **ret, Error **errp)' % c_name(name)
if not middle_mode: if not middle_mode:
ret = 'static ' + ret ret = 'static ' + ret
return ret return ret
...@@ -251,7 +251,7 @@ def gen_register_command(name, success_response): ...@@ -251,7 +251,7 @@ def gen_register_command(name, success_response):
options = 'QCO_NO_SUCCESS_RESP' options = 'QCO_NO_SUCCESS_RESP'
ret = mcgen(''' ret = mcgen('''
qmp_register_command("%(name)s", qmp_marshal_input_%(c_name)s, %(opts)s); qmp_register_command("%(name)s", qmp_marshal_%(c_name)s, %(opts)s);
''', ''',
name=name, c_name=c_name(name), name=name, c_name=c_name(name),
opts=options) opts=options)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册