summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2010-11-22 16:22:47 -0200
committerLuiz Capitulino <lcapitulino@redhat.com>2010-12-06 09:51:41 -0200
commitc01e68853148764d32c3a27ab4b39cb553c567fc (patch)
tree9033d004e11e05df9a0ca6a05b6b7d861e94f4b7 /monitor.c
parent2c90fe2b71df2534884bce96d90cbfcc93aeedb8 (diff)
downloadqemu-c01e68853148764d32c3a27ab4b39cb553c567fc.tar.gz
qemu-c01e68853148764d32c3a27ab4b39cb553c567fc.tar.bz2
qemu-c01e68853148764d32c3a27ab4b39cb553c567fc.zip
QMP: Fix default response regression
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>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/monitor.c b/monitor.c
index ec31eac8c1..1296c40256 100644
--- 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);
}
}