diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2010-09-16 11:06:11 -0300 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2010-10-01 10:20:07 -0300 |
commit | de79ba6f53fa78a6132a67c7ff134014dc8479e7 (patch) | |
tree | 9224a31a3a31ad095fccfa72ca35e1d4910463b6 | |
parent | 4903de0cebb6306e8c660dc0ce3e66fe3b5c35f9 (diff) |
Monitor: Directly call QObject handlers
This avoids handle_user_command() calling monitor_call_handler(),
which is currently shared with QMP.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
-rw-r--r-- | monitor.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -3917,7 +3917,15 @@ static void handle_user_command(Monitor *mon, const char *cmdline) if (handler_is_async(cmd)) { user_async_cmd_handler(mon, cmd, qdict); } else if (handler_is_qobject(cmd)) { - monitor_call_handler(mon, cmd, qdict); + QObject *data = NULL; + + /* XXX: ignores the error code */ + cmd->mhandler.cmd_new(mon, qdict, &data); + assert(!monitor_has_error(mon)); + if (data) { + cmd->user_print(mon, data); + qobject_decref(data); + } } else { cmd->mhandler.cmd(mon, qdict); } |