diff mbox

[for-2.9] block: Declare blockdev-add and blockdev-del supported

Message ID 1490115473-24839-1-git-send-email-armbru@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Markus Armbruster March 21, 2017, 4:57 p.m. UTC
It's been a long journey, but here we are.

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

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 blockdev.c             |  4 ++--
 qapi/block-core.json   | 14 +++++---------
 tests/qemu-iotests/139 |  8 ++++----
 tests/qemu-iotests/141 |  4 ++--
 tests/qemu-iotests/147 |  2 +-
 5 files changed, 14 insertions(+), 18 deletions(-)

Comments

Eric Blake March 21, 2017, 5:08 p.m. UTC | #1
On 03/21/2017 11:57 AM, Markus Armbruster wrote:
> It's been a long journey, but here we are.
> 
> x-blockdev-remove-medium, x-blockdev-insert-medium and
> x-blockdev-change need a bit more work, so leave them alone for now.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  blockdev.c             |  4 ++--
>  qapi/block-core.json   | 14 +++++---------
>  tests/qemu-iotests/139 |  8 ++++----
>  tests/qemu-iotests/141 |  4 ++--
>  tests/qemu-iotests/147 |  2 +-
>  5 files changed, 14 insertions(+), 18 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>
Max Reitz March 22, 2017, 2:10 p.m. UTC | #2
On 21.03.2017 17:57, Markus Armbruster wrote:
> It's been a long journey, but here we are.
> 
> x-blockdev-remove-medium, x-blockdev-insert-medium and
> x-blockdev-change need a bit more work, so leave them alone for now.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  blockdev.c             |  4 ++--
>  qapi/block-core.json   | 14 +++++---------
>  tests/qemu-iotests/139 |  8 ++++----
>  tests/qemu-iotests/141 |  4 ++--
>  tests/qemu-iotests/147 |  2 +-
>  5 files changed, 14 insertions(+), 18 deletions(-)

[...]

> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 0f132fc..5d913d4 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -2907,11 +2907,7 @@
>  # BlockBackend will be created; otherwise, @node-name is mandatory at the top
>  # level and no BlockBackend will be created.
>  #
> -# Note: This command is still a work in progress.  It doesn't support all
> -# block drivers among other things.  Stay away from it unless you want
> -# to help with its development.
> -#
> -# Since: 1.7
> +# Since: 2.9
>  #
>  # Example:
>  #
> @@ -2957,7 +2953,7 @@
>  { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
>  
>  ##
> -# @x-blockdev-del:
> +# @blockdev-del:
>  #
>  # Deletes a block device that has been added using blockdev-add.
>  # The command will fail if the node is attached to a device or is
> @@ -2969,7 +2965,7 @@
>  # experimental. Stay away from it unless you want to help with its
>  # development.

This part of the comment very much looks like it should be removed.

Max

>  #
> -# Since: 2.5
> +# Since: 2.9
>  #
>  # Example:
>  #

[...]
Markus Armbruster March 22, 2017, 3:50 p.m. UTC | #3
Max Reitz <mreitz@redhat.com> writes:

> On 21.03.2017 17:57, Markus Armbruster wrote:
>> It's been a long journey, but here we are.
>> 
>> x-blockdev-remove-medium, x-blockdev-insert-medium and
>> x-blockdev-change need a bit more work, so leave them alone for now.
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  blockdev.c             |  4 ++--
>>  qapi/block-core.json   | 14 +++++---------
>>  tests/qemu-iotests/139 |  8 ++++----
>>  tests/qemu-iotests/141 |  4 ++--
>>  tests/qemu-iotests/147 |  2 +-
>>  5 files changed, 14 insertions(+), 18 deletions(-)
>
> [...]
>
>> diff --git a/qapi/block-core.json b/qapi/block-core.json
>> index 0f132fc..5d913d4 100644
>> --- a/qapi/block-core.json
>> +++ b/qapi/block-core.json
>> @@ -2907,11 +2907,7 @@
>>  # BlockBackend will be created; otherwise, @node-name is mandatory at the top
>>  # level and no BlockBackend will be created.
>>  #
>> -# Note: This command is still a work in progress.  It doesn't support all
>> -# block drivers among other things.  Stay away from it unless you want
>> -# to help with its development.
>> -#
>> -# Since: 1.7
>> +# Since: 2.9
>>  #
>>  # Example:
>>  #
>> @@ -2957,7 +2953,7 @@
>>  { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
>>  
>>  ##
>> -# @x-blockdev-del:
>> +# @blockdev-del:
>>  #
>>  # Deletes a block device that has been added using blockdev-add.
>>  # The command will fail if the node is attached to a device or is
>> @@ -2969,7 +2965,7 @@
>>  # experimental. Stay away from it unless you want to help with its
>>  # development.
>
> This part of the comment very much looks like it should be removed.

v2 coming up, thanks!

> Max
>
>>  #
>> -# Since: 2.5
>> +# Since: 2.9
>>  #
>>  # Example:
>>  #
>
> [...]
diff mbox

Patch

diff --git a/blockdev.c b/blockdev.c
index c5b2c2c..040c152 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -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;
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 0f132fc..5d913d4 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -2907,11 +2907,7 @@ 
 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
 # level and no BlockBackend will be created.
 #
-# Note: This command is still a work in progress.  It doesn't support all
-# block drivers among other things.  Stay away from it unless you want
-# to help with its development.
-#
-# Since: 1.7
+# Since: 2.9
 #
 # Example:
 #
@@ -2957,7 +2953,7 @@ 
 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
 
 ##
-# @x-blockdev-del:
+# @blockdev-del:
 #
 # Deletes a block device that has been added using blockdev-add.
 # The command will fail if the node is attached to a device or is
@@ -2969,7 +2965,7 @@ 
 # experimental. Stay away from it unless you want to help with its
 # development.
 #
-# Since: 2.5
+# Since: 2.9
 #
 # Example:
 #
@@ -2985,13 +2981,13 @@ 
 #    }
 # <- { "return": {} }
 #
-# -> { "execute": "x-blockdev-del",
+# -> { "execute": "blockdev-del",
 #      "arguments": { "node-name": "node0" }
 #    }
 # <- { "return": {} }
 #
 ##
-{ 'command': 'x-blockdev-del', 'data': { 'node-name': 'str' } }
+{ 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
 
 ##
 # @blockdev-open-tray:
diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139
index 6d98e4f..175d8f0 100644
--- a/tests/qemu-iotests/139
+++ b/tests/qemu-iotests/139
@@ -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 <berto@igalia.com>
@@ -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)
diff --git a/tests/qemu-iotests/141 b/tests/qemu-iotests/141
index 6d8f0a1..27fb1cc 100755
--- a/tests/qemu-iotests/141
+++ b/tests/qemu-iotests/141
@@ -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'
 }
diff --git a/tests/qemu-iotests/147 b/tests/qemu-iotests/147
index 45469c9..cca75c5 100755
--- a/tests/qemu-iotests/147
+++ b/tests/qemu-iotests/147
@@ -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', {})