[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC][PATCH v1 05/12] qapi: fix handling for null-return as
From: |
Michael Roth |
Subject: |
[Qemu-devel] [RFC][PATCH v1 05/12] qapi: fix handling for null-return async callbacks |
Date: |
Fri, 25 Mar 2011 14:47:52 -0500 |
Async commands like 'guest-ping' have NULL retvals. Handle these by
inserting an empty dictionary in the response's "return" field.
Signed-off-by: Michael Roth <address@hidden>
---
qmp-core.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/qmp-core.c b/qmp-core.c
index e33f7a4..9f3d182 100644
--- a/qmp-core.c
+++ b/qmp-core.c
@@ -922,9 +922,12 @@ void qmp_async_complete_command(QmpCommandState *cmd,
QObject *retval, Error *er
rsp = qdict_new();
if (err) {
qdict_put_obj(rsp, "error", error_get_qobject(err));
- } else {
+ } else if (retval) {
qobject_incref(retval);
qdict_put_obj(rsp, "return", retval);
+ } else {
+ /* add empty "return" dict, this is the standard for NULL returns */
+ qdict_put_obj(rsp, "return", QOBJECT(qdict_new()));
}
if (cmd->tag) {
qdict_put_obj(rsp, "tag", cmd->tag);
--
1.7.0.4
- [Qemu-devel] [RFC][PATCH v1 00/11] QEMU Guest Agent: QMP-based host/guest communication (virtagent), Michael Roth, 2011/03/25
- [Qemu-devel] [RFC][PATCH v1 01/12] json-lexer: make lexer error-recovery more deterministic, Michael Roth, 2011/03/25
- [Qemu-devel] [RFC][PATCH v1 02/12] json-streamer: add handling for JSON_ERROR token/state, Michael Roth, 2011/03/25
- [Qemu-devel] [RFC][PATCH v1 05/12] qapi: fix handling for null-return async callbacks,
Michael Roth <=
- [Qemu-devel] Re: [RFC][PATCH v1 05/12] qapi: fix handling for null-return async callbacks, Anthony Liguori, 2011/03/25
- [Qemu-devel] Re: [RFC][PATCH v1 05/12] qapi: fix handling for null-return async callbacks, Luiz Capitulino, 2011/03/28
- [Qemu-devel] Re: [RFC][PATCH v1 05/12] qapi: fix handling for null-return async callbacks, Anthony Liguori, 2011/03/28
- [Qemu-devel] Re: [RFC][PATCH v1 05/12] qapi: fix handling for null-return async callbacks, Luiz Capitulino, 2011/03/28
- Re: [Qemu-devel] Re: [RFC][PATCH v1 05/12] qapi: fix handling for null-return async callbacks, Anthony Liguori, 2011/03/28
- Re: [Qemu-devel] Re: [RFC][PATCH v1 05/12] qapi: fix handling for null-return async callbacks, Luiz Capitulino, 2011/03/28
- Re: [Qemu-devel] Re: [RFC][PATCH v1 05/12] qapi: fix handling for null-return async callbacks, Anthony Liguori, 2011/03/28
- [Qemu-devel] Re: [RFC][PATCH v1 05/12] qapi: fix handling for null-return async callbacks, Michael Roth, 2011/03/28
- Re: [Qemu-devel] Re: [RFC][PATCH v1 05/12] qapi: fix handling for null-return async callbacks, Anthony Liguori, 2011/03/28
- Re: [Qemu-devel] Re: [RFC][PATCH v1 05/12] qapi: fix handling for null-return async callbacks, Michael Roth, 2011/03/28