[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 08/25] qapi: ignore top-level 'id' field

From: Marc-André Lureau
Subject: [Qemu-devel] [PATCH v2 08/25] qapi: ignore top-level 'id' field
Date: Wed, 18 Jan 2017 20:03:15 +0400

'id' is documented as part of qmp-spec, it is valid at top-level entry.

The following patch copies the 'id' to the reply, without touching the
original request (which should eventually be const later) so it must
pass the check function without error.

Signed-off-by: Marc-André Lureau <address@hidden>
 qapi/qmp-dispatch.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
index 26f0a674ae..d5c8670a4f 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -48,6 +48,8 @@ static QDict *qmp_dispatch_check_obj(const QObject *request, 
Error **errp)
                 return NULL;
             has_exec_key = true;
+        } else if (!strcmp(arg_name, "id")) {
+            /* top-level 'id' is accepted */
         } else if (strcmp(arg_name, "arguments")) {
             error_setg(errp, QERR_QMP_EXTRA_MEMBER, arg_name);
             return NULL;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]