qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1/3] QMP: Fix default response regression
Date: Tue, 23 Nov 2010 16:49:33 -0200	[thread overview]
Message-ID: <1290538175-2437-2-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1290538175-2437-1-git-send-email-lcapitulino@redhat.com>

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 |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/monitor.c b/monitor.c
index 8cee35d..c4efe58 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4426,10 +4426,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);
     }
 }
 
-- 
1.7.3.2.245.g03276

  reply	other threads:[~2010-11-23 18:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23 18:49 [Qemu-devel] [PATCH 0/3] QMP: small fixes Luiz Capitulino
2010-11-23 18:49 ` Luiz Capitulino [this message]
2010-11-23 18:49 ` [Qemu-devel] [PATCH 2/3] QMP: Drop dead code Luiz Capitulino
2010-12-14 15:23   ` Markus Armbruster
2010-11-23 18:49 ` [Qemu-devel] [PATCH 3/3] QMP: Simplify monitor_json_emitter() Luiz Capitulino
2010-12-14 15:23 ` [Qemu-devel] [PATCH 0/3] QMP: small fixes Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1290538175-2437-2-git-send-email-lcapitulino@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).