From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoHGo-000640-Rj for qemu-devel@nongnu.org; Fri, 01 May 2015 16:10:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YoHGj-0006QT-Sr for qemu-devel@nongnu.org; Fri, 01 May 2015 16:10:46 -0400 Received: from resqmta-po-12v.sys.comcast.net ([2001:558:fe16:19:96:114:154:171]:46654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoHGj-0006QK-M5 for qemu-devel@nongnu.org; Fri, 01 May 2015 16:10:41 -0400 From: Eric Blake Date: Fri, 1 May 2015 14:10:34 -0600 Message-Id: <1430511034-8285-1-git-send-email-eblake@redhat.com> In-Reply-To: <1430312814-19706-23-git-send-email-eblake@redhat.com> References: <1430312814-19706-23-git-send-email-eblake@redhat.com> Subject: [Qemu-devel] [PATCHv7 22a/39] squash: qapi: Unify type bypass and add tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, berto@igalia.com, armbru@redhat.com Signed-off-by: Eric Blake --- This needs to be squashed into v7:22/39 to avoid a regression in QGA. If you'd rather me post a single amended patch as v8, I can do that. scripts/qapi-commands.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py index 053ba85..cb78682 100644 --- a/scripts/qapi-commands.py +++ b/scripts/qapi-commands.py @@ -2,7 +2,7 @@ # QAPI command marshaller generator # # Copyright IBM, Corp. 2011 -# Copyright (C) 2014 Red Hat, Inc. +# Copyright (C) 2014-2015 Red Hat, Inc. # # Authors: # Anthony Liguori @@ -293,17 +293,12 @@ out: return ret -def option_value_matches(opt, val, cmd): - if opt in cmd and cmd[opt] == val: - return True - return False - def gen_registry(commands): registry="" push_indent() for cmd in commands: options = 'QCO_NO_OPTIONS' - if option_value_matches('success-response', 'no', cmd): + if not cmd.get('success-response', True): options = 'QCO_NO_SUCCESS_RESP' registry += mcgen(''' -- 2.1.0