Received: from eggs.gnu.org ([2001:4830:134:3::10]:56406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btWoA-0002KP-Ch for qemu-devel@nongnu.org; Mon, 10 Oct 2016 05:23:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btWo9-0003Hb-BP for qemu-devel@nongnu.org; Mon, 10 Oct 2016 05:23:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60058) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btWo9-0003HL-63 for qemu-devel@nongnu.org; Mon, 10 Oct 2016 05:23:41 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 BB1B9C0567A1 for ; Mon, 10 Oct 2016 09:23:40 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 10 Oct 2016 13:22:47 +0400 Message-Id: <20161010092301.14974-11-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 10/24] qmp: check that async command have an 'id' 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 async support mandates that request have an 'id' (see documentation in following patch). Signed-off-by: Marc-Andr=C3=A9 Lureau --- 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, Qm= pReturn *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; } --=20 2.10.0