From patchwork Sat Feb 20 00:19:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 8365221 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C28839F727 for ; Sat, 20 Feb 2016 00:24:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2994720570 for ; Sat, 20 Feb 2016 00:24:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5AF67200D0 for ; Sat, 20 Feb 2016 00:24:33 +0000 (UTC) Received: from localhost ([::1]:56545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWvLc-000471-M8 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 19 Feb 2016 19:24:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWvHI-0004pT-8A for qemu-devel@nongnu.org; Fri, 19 Feb 2016 19:20:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWvHH-00041K-3F for qemu-devel@nongnu.org; Fri, 19 Feb 2016 19:20:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWvHG-00040g-9k for qemu-devel@nongnu.org; Fri, 19 Feb 2016 19:20:02 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id EF27AC0D7F11; Sat, 20 Feb 2016 00:20:01 +0000 (UTC) Received: from red.redhat.com (ovpn-113-75.phx2.redhat.com [10.3.113.75]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1K0Jn6X025514; Fri, 19 Feb 2016 19:20:01 -0500 From: Eric Blake To: qemu-devel@nongnu.org Date: Fri, 19 Feb 2016 17:19:46 -0700 Message-Id: <1455927587-28033-17-git-send-email-eblake@redhat.com> In-Reply-To: <1455927587-28033-1-git-send-email-eblake@redhat.com> References: <1455927587-28033-1-git-send-email-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: armbru@redhat.com, Michael Roth Subject: [Qemu-devel] [PATCH 16/17] qapi: Use anonymous base in CpuInfo 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now that the generator supports it, we might as well use an anonymous base rather than breaking out a single-use CpuInfoBase structure. Signed-off-by: Eric Blake --- v1: no change Previously posted as part of qapi cleanup subset F: v6: new patch --- scripts/qapi.py | 2 +- qapi-schema.json | 20 ++++++-------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index b8366e8..c5c4bcb 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -62,8 +62,8 @@ returns_whitelist = [ # Whitelist of entities allowed to violate case conventions case_whitelist = [ # From QMP: + ':obj-CpuInfo-base', # CPU, visible through query-cpu 'ACPISlotType', # DIMM, visible through query-acpi-ospm-status - 'CpuInfoBase', # CPU, visible through query-cpu 'CpuInfoMIPS', # PC, visible through query-cpu 'CpuInfoTricore', # PC, visible through query-cpu 'InputAxis', # TODO: drop when x-input-send-event is fixed diff --git a/qapi-schema.json b/qapi-schema.json index f64d4ab..f02e6a1 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -753,9 +753,9 @@ 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] } ## -# @CpuInfoBase: +# @CpuInfo: # -# Common information about a virtual CPU +# Information about a virtual CPU # # @CPU: the index of the virtual CPU # @@ -776,18 +776,10 @@ # Notes: @halted is a transient state that changes frequently. By the time the # data is sent to the client, the guest may no longer be halted. ## -{ 'struct': 'CpuInfoBase', - 'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', - 'qom_path': 'str', 'thread_id': 'int', 'arch': 'CpuInfoArch' } } - -## -# @CpuInfo: -# -# Information about a virtual CPU -# -# Since: 0.14.0 -## -{ 'union': 'CpuInfo', 'base': 'CpuInfoBase', 'discriminator': 'arch', +{ 'union': 'CpuInfo', + 'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', + 'qom_path': 'str', 'thread_id': 'int', 'arch': 'CpuInfoArch' }, + 'discriminator': 'arch', 'data': { 'x86': 'CpuInfoX86', 'sparc': 'CpuInfoSPARC', 'ppc': 'CpuInfoPPC',