Received: from eggs.gnu.org ([2001:4830:134:3::10]:56334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btWo4-0002E6-DL for qemu-devel@nongnu.org; Mon, 10 Oct 2016 05:23:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btWo2-0003CF-Cj for qemu-devel@nongnu.org; Mon, 10 Oct 2016 05:23:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btWo2-0003C8-6z for qemu-devel@nongnu.org; Mon, 10 Oct 2016 05:23:34 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C226385541 for ; Mon, 10 Oct 2016 09:23:33 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 10 Oct 2016 13:22:45 +0400 Message-Id: <20161010092301.14974-9-marcandre.lureau@redhat.com> In-Reply-To: <20161010092301.14974-1-marcandre.lureau@redhat.com> References: <20161010092301.14974-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 08/24] qapi: ignore top-level 'id' field List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: eblake@redhat.com, berrange@redhat.com, armbru@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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. 'id' is documented as part of qmp-spec, it is valid at top-level entry. Signed-off-by: Marc-Andr=C3=A9 Lureau --- qapi/qmp-dispatch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index 7e1ef54..1fedc97 100644 --- a/qapi/qmp-dispatch.c +++ b/qapi/qmp-dispatch.c @@ -48,6 +48,8 @@ static QDict *qmp_dispatch_check_obj(const QObject *req= uest, Error **errp) return NULL; } has_exec_key =3D 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; --=20 2.10.0