mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
qapi: Rename qmp_marshal_input_FOO() to qmp_marshal_FOO()
These functions marshal both input and output. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <1442401589-24189-17-git-send-email-armbru@redhat.com>
This commit is contained in:
@@ -744,7 +744,7 @@ Example:
|
||||
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;
|
||||
UserDefOne *retval;
|
||||
@@ -777,7 +777,7 @@ Example:
|
||||
|
||||
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);
|
||||
|
||||
@@ -127,7 +127,7 @@ following at the bottom:
|
||||
{
|
||||
.name = "hello-world",
|
||||
.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,
|
||||
@@ -179,7 +179,7 @@ The last step is to update the qmp-commands.hx file:
|
||||
{
|
||||
.name = "hello-world",
|
||||
.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
|
||||
@@ -461,7 +461,7 @@ The last step is to add the correspoding entry in the qmp-commands.hx file:
|
||||
{
|
||||
.name = "query-alarm-clock",
|
||||
.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"
|
||||
@@ -607,7 +607,7 @@ To test this you have to add the corresponding qmp-commands.hx entry:
|
||||
{
|
||||
.name = "query-alarm-methods",
|
||||
.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
|
||||
|
||||
@@ -3912,7 +3912,7 @@ static QObject *get_qmp_greeting(void)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
+121
-121
File diff suppressed because it is too large
Load Diff
@@ -157,9 +157,9 @@ VncInfo2List *qmp_query_vnc_servers(Error **errp)
|
||||
* #ifdef CONFIG_SPICE. Necessary for an accurate query-commands
|
||||
* result. However, the QAPI schema is blissfully unaware of that,
|
||||
* and the QAPI code generator happily generates a dead
|
||||
* qmp_marshal_input_query_spice() that calls qmp_query_spice().
|
||||
* Provide it one, or else linking fails.
|
||||
* FIXME Educate the QAPI schema on CONFIG_SPICE.
|
||||
* qmp_marshal_query_spice() that calls qmp_query_spice(). Provide it
|
||||
* one, or else linking fails. FIXME Educate the QAPI schema on
|
||||
* CONFIG_SPICE.
|
||||
*/
|
||||
SpiceInfo *qmp_query_spice(Error **errp)
|
||||
{
|
||||
|
||||
@@ -204,7 +204,7 @@ out:
|
||||
|
||||
|
||||
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:
|
||||
ret = 'static ' + ret
|
||||
return ret
|
||||
@@ -251,7 +251,7 @@ def gen_register_command(name, success_response):
|
||||
options = 'QCO_NO_SUCCESS_RESP'
|
||||
|
||||
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),
|
||||
opts=options)
|
||||
|
||||
Reference in New Issue
Block a user