[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/24] qmp: check that async command have an 'id'
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH 10/24] qmp: check that async command have an 'id' |
Date: |
Mon, 10 Oct 2016 13:22:47 +0400 |
The async support mandates that request have an 'id' (see documentation
in following patch).
Signed-off-by: Marc-André Lureau <address@hidden>
---
qapi/qmp-dispatch.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
index c42fb87..b6a1feb 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -109,6 +109,11 @@ static QObject *do_qmp_dispatch(QObject *request,
QmpReturn *qret, Error **errp)
}
break;
case QCT_ASYNC:
+ if (!qdict_haskey(qret->rsp, "id")) {
+ error_setg(errp, "An async command requires an 'id'");
+ break;
+ }
+
cmd->fn_async(args, qret);
break;
}
--
2.10.0
- Re: [Qemu-devel] [PATCH 01/24] tests: start generic qemu-qmp tests, (continued)
- [Qemu-devel] [PATCH 02/24] tests: change /0.15/* tests to /qmp/*, Marc-André Lureau, 2016/10/10
- [Qemu-devel] [PATCH 03/24] qmp: teach qmp_dispatch() to take a pre-filled QDict, Marc-André Lureau, 2016/10/10
- [Qemu-devel] [PATCH 04/24] qmp: use a return callback for the command reply, Marc-André Lureau, 2016/10/10
- [Qemu-devel] [PATCH 05/24] qmp: add QmpClient, Marc-André Lureau, 2016/10/10
- [Qemu-devel] [PATCH 06/24] qmp: add qmp_return_is_cancelled(), Marc-André Lureau, 2016/10/10
- [Qemu-devel] [PATCH 07/24] qmp: introduce async command type, Marc-André Lureau, 2016/10/10
- [Qemu-devel] [PATCH 08/24] qapi: ignore top-level 'id' field, Marc-André Lureau, 2016/10/10
- [Qemu-devel] [PATCH 10/24] qmp: check that async command have an 'id',
Marc-André Lureau <=
- [Qemu-devel] [PATCH 09/24] qmp: take 'id' from request, Marc-André Lureau, 2016/10/10
- [Qemu-devel] [PATCH 11/24] scripts: learn 'async' qapi commands, Marc-André Lureau, 2016/10/10
- [Qemu-devel] [PATCH 12/24] tests: add dispatch async tests, Marc-André Lureau, 2016/10/10
- [Qemu-devel] [PATCH 13/24] monitor: add 'async' capability, Marc-André Lureau, 2016/10/10
- [Qemu-devel] [PATCH 14/24] monitor: add !qmp pre-conditions, Marc-André Lureau, 2016/10/10
- [Qemu-devel] [PATCH 15/24] monitor: suspend when running async and client has no async, Marc-André Lureau, 2016/10/10
- [Qemu-devel] [PATCH 16/24] qmp: update qmp-spec about async capability, Marc-André Lureau, 2016/10/10
- [Qemu-devel] [PATCH 17/24] qtest: add qtest-timeout, Marc-André Lureau, 2016/10/10
- [Qemu-devel] [PATCH 19/24] tests: add tests for async and non-async clients, Marc-André Lureau, 2016/10/10
- [Qemu-devel] [PATCH 18/24] qtest: add qtest_init_qmp_caps(), Marc-André Lureau, 2016/10/10