[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 29/36] qapi: take 'id' from request
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH 29/36] qapi: take 'id' from request |
Date: |
Fri, 25 Sep 2015 16:03:57 +0200 |
From: Marc-André Lureau <address@hidden>
Copy 'id' from request to reply dict. This can be done earlier, such as
done by the monitor (because the qemu monitor may reply directly without
qmp_dispatch), but is now done as well in qmp_dispatch() as convenience
for other users such as QGA and tests.
Signed-off-by: Marc-André Lureau <address@hidden>
---
qapi/qmp-dispatch.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
index 73ba3ad..44bd1e8 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -175,7 +175,8 @@ void qmp_dispatch(QmpClient *client, QObject *request,
QDict *rsp)
{
Error *err = NULL;
QmpReturn *qret = g_new0(QmpReturn, 1);
- QObject *ret;
+ QObject *ret, *id;
+ QDict *req;
assert(client);
@@ -183,6 +184,14 @@ void qmp_dispatch(QmpClient *client, QObject *request,
QDict *rsp)
qret->client = client;
QLIST_INSERT_HEAD(&client->pending, qret, link);
+ req = qobject_to_qdict(request);
+ id = qdict_get(req, "id");
+ if (id) {
+ qobject_incref(id);
+ qdict_del(req, "id");
+ qdict_put_obj(qret->rsp, "id", id);
+ }
+
ret = do_qmp_dispatch(request, qret, &err);
if (err) {
--
2.4.3
- Re: [Qemu-devel] [PATCH 20/36] qmp: remove old qmp-commands table, (continued)
- [Qemu-devel] [PATCH 22/36] qmp: teach qmp_dispatch() to take a pre-filled QDict, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 24/36] qmp: add QmpClient, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 26/36] qmp: check that async command have an 'id', marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 27/36] scripts: learn 'async' qapi commands, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 25/36] qmp: introduce async command type, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 28/36] scripts: ensure -async commands are declared async, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 30/36] tests: change /0.15/* tests to /qmp/*, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 31/36] tests: add /qmp/dispatch_cmd_async test, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 29/36] qapi: take 'id' from request,
marcandre . lureau <=
- [Qemu-devel] [PATCH 34/36] console: graphic_hw_update return true if async, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 35/36] console: add graphic_hw_update_done(), marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 33/36] monitor: add 'async' capability, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 32/36] qmp: update qmp-spec about async capability, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 36/36] console: add screendump-async, marcandre . lureau, 2015/09/25
- Re: [Qemu-devel] [PATCH 00/36] post-Eric's fixes, QAPI improvements, Markus Armbruster, 2015/09/25
- Re: [Qemu-devel] [PATCH 00/36] post-Eric's fixes, QAPI improvements, Eric Blake, 2015/09/25