From patchwork Fri Jun 6 16:14:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 356951 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 79238140085 for ; Sat, 7 Jun 2014 02:32:46 +1000 (EST) Received: from localhost ([::1]:48313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsx4O-0004l7-E3 for incoming@patchwork.ozlabs.org; Fri, 06 Jun 2014 12:32:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsx3Q-0003G0-FN for qemu-devel@nongnu.org; Fri, 06 Jun 2014 12:31:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wsx3H-00026j-Bk for qemu-devel@nongnu.org; Fri, 06 Jun 2014 12:31:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsx3H-00026d-3C for qemu-devel@nongnu.org; Fri, 06 Jun 2014 12:31:35 -0400 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 (8.14.4/8.14.4) with ESMTP id s56GVVPv002581 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 6 Jun 2014 12:31:31 -0400 Received: from localhost (ovpn-112-25.ams2.redhat.com [10.36.112.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s56GFa6R004064; Fri, 6 Jun 2014 12:15:37 -0400 From: Stefan Hajnoczi To: Date: Fri, 6 Jun 2014 18:14:00 +0200 Message-Id: <1402071243-16702-40-git-send-email-stefanha@redhat.com> In-Reply-To: <1402071243-16702-1-git-send-email-stefanha@redhat.com> References: <1402071243-16702-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id s56GVVPv002581 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: =?UTF-8?q?Beno=C3=AEt=20Canet?= , Peter Maydell , Benoit Canet , Stefan Hajnoczi Subject: [Qemu-devel] [PULL 39/42] qapi: Extract qapi/common.json definitions 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: BenoƮt Canet Signed-off-by: Benoit Canet Reviewed-by: Eric Blake Signed-off-by: Stefan Hajnoczi --- qapi-schema.json | 87 ++---------------------------------------------------- qapi/common.json | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 85 deletions(-) create mode 100644 qapi/common.json diff --git a/qapi-schema.json b/qapi-schema.json index 7bc33ea..cc71b27 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -2,32 +2,8 @@ # # QAPI Schema -## -# @ErrorClass -# -# QEMU error classes -# -# @GenericError: this is used for errors that don't require a specific error -# class. This should be the default case for most errors -# -# @CommandNotFound: the requested command has not been found -# -# @DeviceEncrypted: the requested operation can't be fulfilled because the -# selected device is encrypted -# -# @DeviceNotActive: a device has failed to be become active -# -# @DeviceNotFound: the requested device has not been found -# -# @KVMMissingCap: the requested operation can't be fulfilled because a -# required KVM capability is missing -# -# Since: 1.2 -## -{ 'enum': 'ErrorClass', - 'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted', - 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] } - +# QAPI common definitions +{ 'include': 'qapi/common.json' } ## # LostTickPolicy: @@ -134,43 +110,6 @@ { 'command': 'query-name', 'returns': 'NameInfo' } ## -# @VersionInfo: -# -# A description of QEMU's version. -# -# @qemu.major: The major version of QEMU -# -# @qemu.minor: The minor version of QEMU -# -# @qemu.micro: The micro version of QEMU. By current convention, a micro -# version of 50 signifies a development branch. A micro version -# greater than or equal to 90 signifies a release candidate for -# the next minor version. A micro version of less than 50 -# signifies a stable release. -# -# @package: QEMU will always set this field to an empty string. Downstream -# versions of QEMU should set this to a non-empty string. The -# exact format depends on the downstream however it highly -# recommended that a unique name is used. -# -# Since: 0.14.0 -## -{ 'type': 'VersionInfo', - 'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'}, - 'package': 'str'} } - -## -# @query-version: -# -# Returns the current version of QEMU. -# -# Returns: A @VersionInfo object describing the current version of QEMU. -# -# Since: 0.14.0 -## -{ 'command': 'query-version', 'returns': 'VersionInfo' } - -## # @KvmInfo: # # Information about support for KVM acceleration @@ -584,28 +523,6 @@ 'returns': 'str' } ## -# @CommandInfo: -# -# Information about a QMP command -# -# @name: The command name -# -# Since: 0.14.0 -## -{ 'type': 'CommandInfo', 'data': {'name': 'str'} } - -## -# @query-commands: -# -# Return a list of supported QMP commands by this server -# -# Returns: A list of @CommandInfo for all supported commands -# -# Since: 0.14.0 -## -{ 'command': 'query-commands', 'returns': ['CommandInfo'] } - -## # @EventInfo: # # Information about a QMP event diff --git a/qapi/common.json b/qapi/common.json new file mode 100644 index 0000000..4e9a21f --- /dev/null +++ b/qapi/common.json @@ -0,0 +1,89 @@ +# -*- Mode: Python -*- +# +# QAPI common definitions + +## +# @ErrorClass +# +# QEMU error classes +# +# @GenericError: this is used for errors that don't require a specific error +# class. This should be the default case for most errors +# +# @CommandNotFound: the requested command has not been found +# +# @DeviceEncrypted: the requested operation can't be fulfilled because the +# selected device is encrypted +# +# @DeviceNotActive: a device has failed to be become active +# +# @DeviceNotFound: the requested device has not been found +# +# @KVMMissingCap: the requested operation can't be fulfilled because a +# required KVM capability is missing +# +# Since: 1.2 +## +{ 'enum': 'ErrorClass', + 'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted', + 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] } + +## +# @VersionInfo: +# +# A description of QEMU's version. +# +# @qemu.major: The major version of QEMU +# +# @qemu.minor: The minor version of QEMU +# +# @qemu.micro: The micro version of QEMU. By current convention, a micro +# version of 50 signifies a development branch. A micro version +# greater than or equal to 90 signifies a release candidate for +# the next minor version. A micro version of less than 50 +# signifies a stable release. +# +# @package: QEMU will always set this field to an empty string. Downstream +# versions of QEMU should set this to a non-empty string. The +# exact format depends on the downstream however it highly +# recommended that a unique name is used. +# +# Since: 0.14.0 +## +{ 'type': 'VersionInfo', + 'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'}, + 'package': 'str'} } + +## +# @query-version: +# +# Returns the current version of QEMU. +# +# Returns: A @VersionInfo object describing the current version of QEMU. +# +# Since: 0.14.0 +## +{ 'command': 'query-version', 'returns': 'VersionInfo' } + +## +# @CommandInfo: +# +# Information about a QMP command +# +# @name: The command name +# +# Since: 0.14.0 +## +{ 'type': 'CommandInfo', 'data': {'name': 'str'} } + +## +# @query-commands: +# +# Return a list of supported QMP commands by this server +# +# Returns: A list of @CommandInfo for all supported commands +# +# Since: 0.14.0 +## +{ 'command': 'query-commands', 'returns': ['CommandInfo'] } +