Monitor: Directly call QObject handlers
authorLuiz Capitulino <lcapitulino@redhat.com>
Thu, 16 Sep 2010 14:06:11 +0000 (11:06 -0300)
committerLuiz Capitulino <lcapitulino@redhat.com>
Fri, 1 Oct 2010 13:20:07 +0000 (10:20 -0300)
This avoids handle_user_command() calling monitor_call_handler(),
which is currently shared with QMP.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
monitor.c

index 7959504595addab2fc8b1fb3d7f0a0f112680b9b..03f3c186fd0d1db621805d6d7fa8f6288ae32f7b 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -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);
     }