Skip to contentSkip to conversation

move BlockdevRef definition before using it

PATCH In review Amos Kong 3 participants 3 messages Oct 30, 2013

lore
Share & tools
lore

Amos Kong

author
#0 lore raw

PATCH 1/1 move BlockdevRef definition before using it

From: Amos Kong <[email protected]>

@BlockdevRef is used in @BlockdevOptionsGenericFormat and @BlockdevOptionsGenericCOWFormat.

---
 qapi-schema.json | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)
qapi-schema.json +17 -17
index 60f3fd1..8af8187 100644
@@ -4061,6 +4061,23 @@
             '*rw': 'bool' } }
 
 ##
+# @BlockdevRef
+#
+# Reference to a block device.
+#
+# @definition:      defines a new block device inline
+# @reference:       references the ID of an existing block device. An
+#                   empty string means that no block device should be
+#                   referenced.
+#
+# Since: 1.7
+##
+{ 'union': 'BlockdevRef',
+  'discriminator': {},
+  'data': { 'definition': 'BlockdevOptions',
+            'reference': 'str' } }
+
+##
 # @BlockdevOptionsGenericFormat
 #
 # Driver specific block device options for image format that have no option
@@ -4162,23 +4179,6 @@
   } }
 
 ##
-# @BlockdevRef
-#
-# Reference to a block device.
-#
-# @definition:      defines a new block device inline
-# @reference:       references the ID of an existing block device. An
-#                   empty string means that no block device should be
-#                   referenced.
-#
-# Since: 1.7
-##
-{ 'union': 'BlockdevRef',
-  'discriminator': {},
-  'data': { 'definition': 'BlockdevOptions',
-            'reference': 'str' } }
-
-##
 # @blockdev-add:
 #
 # Creates a new block device.
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 5 lines · Amos Kong

From: Amos Kong <[email protected]>

@BlockdevRef is used in @BlockdevOptionsGenericFormat and @BlockdevOptionsGenericCOWFormat.

NACK this patch.

@BlockdevOptions is used in @BlockdevRef, this change is meaningless.

Quoted 61 lines
---
 qapi-schema.json | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)
qapi-schema.json +17 -18
index 60f3fd1..8af8187 100644
@@ -4061,6 +4061,23 @@
             '*rw': 'bool' } }
 
 ##
+# @BlockdevRef
+#
+# Reference to a block device.
+#
+# @definition:      defines a new block device inline
+# @reference:       references the ID of an existing block device. An
+#                   empty string means that no block device should be
+#                   referenced.
+#
+# Since: 1.7
+##
+{ 'union': 'BlockdevRef',
+  'discriminator': {},
+  'data': { 'definition': 'BlockdevOptions',
+            'reference': 'str' } }
+
+##
 # @BlockdevOptionsGenericFormat
 #
 # Driver specific block device options for image format that have no option
@@ -4162,23 +4179,6 @@
   } }
 
 ##
-# @BlockdevRef
-#
-# Reference to a block device.
-#
-# @definition:      defines a new block device inline
-# @reference:       references the ID of an existing block device. An
-#                   empty string means that no block device should be
-#                   referenced.
-#
-# Since: 1.7
-##
-{ 'union': 'BlockdevRef',
-  'discriminator': {},
-  'data': { 'definition': 'BlockdevOptions',
-            'reference': 'str' } }
-
-##
 # @blockdev-add:
 #
 # Creates a new block device.
--

1.8.3.1

#2 lore raw
Quoted 10 lines · Amos Kong
Quoted 5 lines · Amos Kong

From: Amos Kong <[email protected]>

@BlockdevRef is used in @BlockdevOptionsGenericFormat and @BlockdevOptionsGenericCOWFormat.

NACK this patch.

@BlockdevOptions is used in @BlockdevRef, this change is meaningless.

Furthermore, qapi allows circular recursive types, so we can't do full topological sorting (the generator handles a reference to a type before its declaration just fine, as long as all names encountered in the file can be resolved at the time the complete file has been parsed).

If anything, I think that alphabetical ordering _might_ make it easier to find types, instead of the current ad hoc ordering. Also, at one point there was a patch proposed to allow file inclusion, where you could break out related types/commands into a secondary file rather than cramming everything into qapi-schema.json, but I don't know if that's worth reviving.

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