QMP: Fix default response regression
authorLuiz Capitulino <lcapitulino@redhat.com>
Mon, 22 Nov 2010 18:22:47 +0000 (16:22 -0200)
committerLuiz Capitulino <lcapitulino@redhat.com>
Mon, 6 Dec 2010 11:51:41 +0000 (09:51 -0200)
Commit 030db6e89d dropped do_info() usage from QMP and introduced
qmp_call_query_cmd(). However, the new function doesn't emit QMP's
default OK response when the handler doesn't return data.

Fix that by also calling monitor_protocol_emitter() when
ret_data == NULL, so that the default response is emitted.

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

index ec31eac8c1e238e6a9cbe6f027e831097985bd19..1296c40256a3bfdfadcfc7596e6cc06467146c6c 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -4464,10 +4464,8 @@ static void qmp_call_query_cmd(Monitor *mon, const mon_cmd_t *cmd)
         }
     } else {
         cmd->mhandler.info_new(mon, &ret_data);
-        if (ret_data) {
-            monitor_protocol_emitter(mon, ret_data);
-            qobject_decref(ret_data);
-        }
+        monitor_protocol_emitter(mon, ret_data);
+        qobject_decref(ret_data);
     }
 }