Commit 7fad30f0 authored by Markus Armbruster's avatar Markus Armbruster
Browse files

qapi: Rename qmp_marshal_input_FOO() to qmp_marshal_FOO()



These functions marshal both input and output.

Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
Message-Id: <1442401589-24189-17-git-send-email-armbru@redhat.com>
parent f1538019
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
+4 −4
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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 changed.

Preview size limit exceeded, changes collapsed.

+3 −3
Original line number Diff line number Diff line
@@ -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)
{
Loading