Skip to contentSkip to conversation

block: Declare blockdev-add and blockdev-del supported

PATCH In review Markus Armbruster 3 participants 4 messages Mar 22, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 block: Declare blockdev-add and blockdev-del supported

It's been a long journey, but here we are.

The supported blockdev-add is not compatible to its experimental predecessors; bump all Since: tags to 2.9.

x-blockdev-remove-medium, x-blockdev-insert-medium and x-blockdev-change need a bit more work, so leave them alone for now.

---
v2:
* Another "command is considered experimental" comment dropped [Max]
* More Since: tags updated to 2.9, commit message improved, R-bys dropped

 blockdev.c             |  4 +--
 qapi/block-core.json   | 69 ++++++++++++++++++--------------------------------
 tests/qemu-iotests/139 |  8 +++---
 tests/qemu-iotests/141 |  4 +--
 tests/qemu-iotests/147 |  2 +-
 5 files changed, 34 insertions(+), 53 deletions(-)
blockdev.c +2 -2
index c5b2c2c..040c152 100644
@@ -2835,7 +2835,7 @@ void hmp_drive_del(Monitor *mon, const QDict *qdict)
 
     bs = bdrv_find_node(id);
     if (bs) {
-        qmp_x_blockdev_del(id, &local_err);
+        qmp_blockdev_del(id, &local_err);
         if (local_err) {
             error_report_err(local_err);
         }
@@ -3900,7 +3900,7 @@ fail:
     visit_free(v);
 }
 
-void qmp_x_blockdev_del(const char *node_name, Error **errp)
+void qmp_blockdev_del(const char *node_name, Error **errp)
 {
     AioContext *aio_context;
     BlockDriverState *bs;
qapi/block-core.json +25 -44

218 lines not on this page · raw message

tests/qemu-iotests/139 +4 -4
index 6d98e4f..175d8f0 100644
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Test cases for the QMP 'x-blockdev-del' command
+# Test cases for the QMP 'blockdev-del' command
 #
 # Copyright (C) 2015 Igalia, S.L.
 # Author: Alberto Garcia <[email protected]>
@@ -79,7 +79,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
     # Delete a BlockDriverState
     def delBlockDriverState(self, node, expect_error = False):
         self.checkBlockDriverState(node)
-        result = self.vm.qmp('x-blockdev-del', node_name = node)
+        result = self.vm.qmp('blockdev-del', node_name = node)
         if expect_error:
             self.assert_qmp(result, 'error/class', 'GenericError')
         else:
@@ -173,7 +173,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
         self.wait_until_completed(id)
 
     # Add a BlkDebug node
-    # Note that the purpose of this is to test the x-blockdev-del
+    # Note that the purpose of this is to test the blockdev-del
     # sanity checks, not to create a usable blkdebug drive
     def addBlkDebug(self, debug, node):
         self.checkBlockDriverState(node, False)
@@ -191,7 +191,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
         self.checkBlockDriverState(debug)
 
     # Add a BlkVerify node
-    # Note that the purpose of this is to test the x-blockdev-del
+    # Note that the purpose of this is to test the blockdev-del
     # sanity checks, not to create a usable blkverify drive
     def addBlkVerify(self, blkverify, test, raw):
         self.checkBlockDriverState(test, False)
tests/qemu-iotests/141 +2 -2
index 6d8f0a1..27fb1cc 100755
@@ -65,7 +65,7 @@ test_blockjob()
 
     # We want this to return an error because the block job is still running
     _send_qemu_cmd $QEMU_HANDLE \
-        "{'execute': 'x-blockdev-del',
+        "{'execute': 'blockdev-del',
           'arguments': {'node-name': 'drv0'}}" \
         'error' | _filter_generated_node_ids
 
@@ -75,7 +75,7 @@ test_blockjob()
         "$3"
 
     _send_qemu_cmd $QEMU_HANDLE \
-        "{'execute': 'x-blockdev-del',
+        "{'execute': 'blockdev-del',
           'arguments': {'node-name': 'drv0'}}" \
         'return'
 }
tests/qemu-iotests/147 +1 -1
index 45469c9..cca75c5 100755
@@ -57,7 +57,7 @@ class NBDBlockdevAddBase(iotests.QMPTestCase):
                                                     filename)
                 break
 
-        result = self.vm.qmp('x-blockdev-del', node_name='nbd-blockdev')
+        result = self.vm.qmp('blockdev-del', node_name='nbd-blockdev')
         self.assert_qmp(result, 'return', {})
 
 
Signature · 1 line
2.7.4
Reviewed-by on v2 1/1
#1 lore raw
Quoted 5 lines · Markus Armbruster

It's been a long journey, but here we are.

The supported blockdev-add is not compatible to its experimental predecessors; bump all Since: tags to 2.9.

Quoted 8 lines

x-blockdev-remove-medium, x-blockdev-insert-medium and x-blockdev-change need a bit more work, so leave them alone for now.

---
v2:
* Another "command is considered experimental" comment dropped [Max]
* More Since: tags updated to 2.9, commit message improved, R-bys dropped

Do you want to do this recursively? There are things such as BlkdebugSetStateOptions or ReplicationMode which are only used by the corresponding BlockdevOptions*, so they too are basically only supported as of 2.9.

I don't have a strong opinion, but I think I personally wouldn't bother with any of these structures and just update the tag for blockdev-add itself...

You being fine with me would be enough to convince me, so:

Quoted 7 lines
 blockdev.c             |  4 +--
 qapi/block-core.json   | 69 ++++++++++++++++++--------------------------------
 tests/qemu-iotests/139 |  8 +++---
 tests/qemu-iotests/141 |  4 +--
 tests/qemu-iotests/147 |  2 +-
 5 files changed, 34 insertions(+), 53 deletions(-)
Reviewed-by
#2 lore raw
Quoted 15 lines · Max Reitz
Quoted 5 lines · Markus Armbruster

It's been a long journey, but here we are.

The supported blockdev-add is not compatible to its experimental predecessors; bump all Since: tags to 2.9.

Quoted 8 lines

x-blockdev-remove-medium, x-blockdev-insert-medium and x-blockdev-change need a bit more work, so leave them alone for now.

---
v2:
* Another "command is considered experimental" comment dropped [Max]
* More Since: tags updated to 2.9, commit message improved, R-bys dropped

Quoted 8 lines

Do you want to do this recursively? There are things such as BlkdebugSetStateOptions or ReplicationMode which are only used by the corresponding BlockdevOptions*, so they too are basically only supported as of 2.9.

I don't have a strong opinion, but I think I personally wouldn't bother with any of these structures and just update the tag for blockdev-add itself...

I also don't have a strong opinion, and think it may actually be a bit more time consuming to audit which types are recursively used only by blockdev-add (and no where else) than to just leave them be. But I'm also okay if you like bumping the numbers to the point where the struct was marked stable, and where we have to start thinking about back-compat ramifications when modifying the struct.

Quoted 4 lines

You being fine with me would be enough to convince me, so:

Likewise.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#3 lore raw
In reply to Max Reitz
Quoted 15 lines · Max Reitz
Quoted 5 lines · Markus Armbruster

It's been a long journey, but here we are.

The supported blockdev-add is not compatible to its experimental predecessors; bump all Since: tags to 2.9.

Quoted 8 lines

x-blockdev-remove-medium, x-blockdev-insert-medium and x-blockdev-change need a bit more work, so leave them alone for now.

---
v2:
* Another "command is considered experimental" comment dropped [Max]
* More Since: tags updated to 2.9, commit message improved, R-bys dropped

Quoted 4 lines

Do you want to do this recursively? There are things such as BlkdebugSetStateOptions or ReplicationMode which are only used by the corresponding BlockdevOptions*, so they too are basically only supported as of 2.9.

Fixup appended.

Quoted 3 lines

I don't have a strong opinion, but I think I personally wouldn't bother with any of these structures and just update the tag for blockdev-add itself...

Kevin, what about you?

Since: tags on types are kind of redundant, as types become part of the public interface only via commands and events. The real Since: is the oldest command or event exposing it. But explaining that is too complicated. It's better to tell people to always add Since: tags.

Now if the QAPI generators could tell them when to add and when not to add Since: tags...

Quoted 3 lines

You being fine with me would be enough to convince me, so:

Thanks!

qapi/block-core.json +13 -13
index bd39b3f..f938316 100644
@@ -2053,7 +2053,7 @@
 # @ignore:      Ignore the request
 # @unmap:       Forward as an unmap request
 #
-# Since: 1.7
+# Since: 2.9
 ##
 { 'enum': 'BlockdevDiscardOptions',
   'data': [ 'ignore', 'unmap' ] }
@@ -2082,7 +2082,7 @@
 # @threads:     Use qemu's thread pool
 # @native:      Use native AIO backend (only Linux and Windows)
 #
-# Since: 1.7
+# Since: 2.9
 ##
 { 'enum': 'BlockdevAioOptions',
   'data': [ 'threads', 'native' ] }
@@ -2097,7 +2097,7 @@
 # @no-flush:    ignore any flush requests for the device (default:
 #               false)
 #
-# Since: 1.7
+# Since: 2.9
 ##
 { 'struct': 'BlockdevCacheOptions',
   'data': { '*direct': 'bool',
@@ -2229,7 +2229,7 @@
 #
 # @all:         Perform all available overlap checks
 #
-# Since: 2.2
+# Since: 2.9
 ##
 { 'enum': 'Qcow2OverlapCheckMode',
   'data': [ 'none', 'constant', 'cached', 'all' ] }
@@ -2244,7 +2244,7 @@
 # @template: Specifies a template mode which can be adjusted using the other
 #            flags, defaults to 'cached'
 #
-# Since: 2.2
+# Since: 2.9
 ##
 { 'struct': 'Qcow2OverlapCheckFlags',
   'data': { '*template':       'Qcow2OverlapCheckMode',
@@ -2268,7 +2268,7 @@
 #
 # @mode:    named mode which chooses a specific set of flags
 #
-# Since: 2.2
+# Since: 2.9
 ##
 { 'alternate': 'Qcow2OverlapChecks',
   'data': { 'flags': 'Qcow2OverlapCheckFlags',
@@ -2349,7 +2349,7 @@
 #
 # Trigger events supported by blkdebug.
 #
-# Since: 2.0
+# Since: 2.9
 ##
 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
   'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
@@ -2389,7 +2389,7 @@
 #
 # @immediately: fail immediately; defaults to false
 #
-# Since: 2.0
+# Since: 2.9
 ##
 { 'struct': 'BlkdebugInjectErrorOptions',
   'data': { 'event': 'BlkdebugEvent',
@@ -2412,7 +2412,7 @@
 # @new_state:   the state identifier blkdebug is supposed to assume if
 #               this event is triggered
 #
-# Since: 2.0
+# Since: 2.9
 ##
 { 'struct': 'BlkdebugSetStateOptions',
   'data': { 'event': 'BlkdebugEvent',
@@ -2468,7 +2468,7 @@
 #
 # @fifo: read only from the first child that has not failed
 #
-# Since: 2.2
+# Since: 2.9
 ##
 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
 
@@ -2674,7 +2674,7 @@
 #
 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
 #
-# Since: 2.8
+# Since: 2.9
 ##
 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ] }
 
@@ -2703,7 +2703,7 @@
 #
 # @inet:        TCP transport
 #
-# Since: 2.8
+# Since: 2.9
 ##
 { 'enum': 'NFSTransport',
   'data': [ 'inet' ] }
@@ -2717,7 +2717,7 @@
 #
 # @host:        host address for NFS server
 #
-# Since: 2.8
+# Since: 2.9
 ##
 { 'struct': 'NFSServer',
   'data': { 'type': 'NFSTransport',