From patchwork Fri Sep 25 14:03:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 522840 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A305D14027C for ; Sat, 26 Sep 2015 00:22:44 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=JfTY4JRS; dkim-atps=neutral Received: from localhost ([::1]:42124 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfTta-0002vE-D3 for incoming@patchwork.ozlabs.org; Fri, 25 Sep 2015 10:22:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfTcF-0007GA-2G for qemu-devel@nongnu.org; Fri, 25 Sep 2015 10:04:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfTcB-0003jI-8f for qemu-devel@nongnu.org; Fri, 25 Sep 2015 10:04:46 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:37825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfTcB-0003j6-2d for qemu-devel@nongnu.org; Fri, 25 Sep 2015 10:04:43 -0400 Received: by wicfx3 with SMTP id fx3so21037274wic.0 for ; Fri, 25 Sep 2015 07:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=Jdsom8pu9yT2vuOg5s6OZFKgL4ivPSb07A82cQ+rSB8=; b=JfTY4JRS524Q1ckt0WP+XI72ZEpEtwu1YrJNPr03Ewq2CY6gBCbJb58BTVzqjJbKGA L+2n4sTtxfTiwxNcdS77GcaADjM7obEnvpM5w5Ot6CRedG88VCriD8kylqD7cwEBUAkz MuAfBJImj/zKZDpPC8IUVBamGDb+hJ6cWKH6GzX7HvqJQVkpItIIt4Aajpa9X8vvYQZ6 qB/iTJGDnT/DB9muCLoYInY+6Z25ZFnolqO1veup0ppf9DGs0SF12mdnjGdiu8PQ/HTj aJZ4Mftt8gnkgLUet6WwTVoDb9wOixpjvNwQHILau2M5I4Dz7w/AnJ/u9UBKMUcLFa5N 3YFg== X-Received: by 10.194.23.167 with SMTP id n7mr6252870wjf.112.1443189882493; Fri, 25 Sep 2015 07:04:42 -0700 (PDT) Received: from localhost ([149.6.167.210]) by smtp.gmail.com with ESMTPSA id xt1sm3518838wjb.32.2015.09.25.07.04.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Sep 2015 07:04:41 -0700 (PDT) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Date: Fri, 25 Sep 2015 16:03:54 +0200 Message-Id: <1443189844-20341-27-git-send-email-marcandre.lureau@redhat.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1443189844-20341-1-git-send-email-marcandre.lureau@redhat.com> References: <1443189844-20341-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::229 Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , armbru@redhat.com, mdroth@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH 26/36] qmp: check that async command have an 'id' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau The async support mandates that request have an 'id' (see documentation in following patch). Signed-off-by: Marc-André Lureau --- qapi/qmp-dispatch.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index 83ecab5..73ba3ad 100644 --- a/qapi/qmp-dispatch.c +++ b/qapi/qmp-dispatch.c @@ -105,6 +105,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; }