[Qemu-devel] [PATCH v2 1/5] qapi: Extract qapi/common.json definitions

2014-06-05 Thread Benoît Canet
Signed-off-by: Benoit Canet ben...@irqsave.net
---
 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 000..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
+#  

Re: [Qemu-devel] [PATCH v2 1/5] qapi: Extract qapi/common.json definitions

2014-06-05 Thread Eric Blake
On 06/05/2014 05:45 AM, Benoît Canet wrote:
 Signed-off-by: Benoit Canet ben...@irqsave.net
 ---
  qapi-schema.json | 87 ++
  qapi/common.json | 89 
 
  2 files changed, 91 insertions(+), 85 deletions(-)
  create mode 100644 qapi/common.json

Reviewed-by: Eric Blake ebl...@redhat.com

Much nicer.  Here's the intra-diff showing that the motion is fairly
straightforward:

$ diff -u (sed -n 's/^-//p'  patch1) \
  (sed -n 's/^\+//p' patch1)
--- /dev/fd/63  2014-06-05 09:15:37.189091311 -0600
+++ /dev/fd/62  2014-06-05 09:15:37.190091308 -0600
@@ -1,5 +1,11 @@
---
--- a/qapi-schema.json
+++ b/qapi-schema.json
+# QAPI common definitions
+{ 'include': 'qapi/common.json' }
+++ b/qapi/common.json
+# -*- Mode: Python -*-
+#
+# QAPI common definitions
+
 ##
 # @ErrorClass
 #
@@ -26,6 +32,7 @@
   'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted',
 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }

+##
 # @VersionInfo:
 #
 # A description of QEMU's version.
@@ -84,6 +91,3 @@
 ##
 { 'command': 'query-commands', 'returns': ['CommandInfo'] }

-##
--- /dev/null
-- 

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature