All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 09/29] blockdev: Mark BD-{remove, insert}-medium stable
Date: Tue, 23 Jan 2018 15:01:41 +0100	[thread overview]
Message-ID: <20180123140201.31163-10-kwolf@redhat.com> (raw)
In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com>

From: Max Reitz <mreitz@redhat.com>

Now that iotest 093 test proves that the throttling configuration
survives a blockdev-remove-medium/blockdev-insert-medium pair, the
original reason for declaring these commands experimental is gone
(see commit 6e0abc251dd4f8eba1f53656dfede12e5840e83b).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20171110224302.14424-5-mreitz@redhat.com
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 qapi/block-core.json   | 32 +++++++++++++-------------------
 blockdev.c             |  6 +++---
 tests/ahci-test.c      |  4 ++--
 tests/qemu-iotests/093 |  6 +++---
 tests/qemu-iotests/118 | 20 ++++++++++----------
 tests/qemu-iotests/139 |  2 +-
 6 files changed, 32 insertions(+), 38 deletions(-)

diff --git a/qapi/block-core.json b/qapi/block-core.json
index d1df47de26..89ed2bc6a4 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -3403,7 +3403,7 @@
             '*id': 'str' } }
 
 ##
-# @x-blockdev-remove-medium:
+# @blockdev-remove-medium:
 #
 # Removes a medium (a block driver state tree) from a block device. That block
 # device's tray must currently be open (unless there is no attached guest
@@ -3411,16 +3411,13 @@
 #
 # If the tray is open and there is no medium inserted, this will be a no-op.
 #
-# @id:     The name or QOM path of the guest device (since: 2.8)
-#
-# Note: This command is still a work in progress and is considered experimental.
-# Stay away from it unless you want to help with its development.
+# @id:     The name or QOM path of the guest device
 #
-# Since: 2.5
+# Since: 2.12
 #
 # Example:
 #
-# -> { "execute": "x-blockdev-remove-medium",
+# -> { "execute": "blockdev-remove-medium",
 #      "arguments": { "id": "ide0-1-0" } }
 #
 # <- { "error": { "class": "GenericError",
@@ -3438,30 +3435,27 @@
 #
 # <- { "return": {} }
 #
-# -> { "execute": "x-blockdev-remove-medium",
+# -> { "execute": "blockdev-remove-medium",
 #      "arguments": { "id": "ide0-1-0" } }
 #
 # <- { "return": {} }
 #
 ##
-{ 'command': 'x-blockdev-remove-medium',
+{ 'command': 'blockdev-remove-medium',
   'data': { 'id': 'str' } }
 
 ##
-# @x-blockdev-insert-medium:
+# @blockdev-insert-medium:
 #
 # Inserts a medium (a block driver state tree) into a block device. That block
 # device's tray must currently be open (unless there is no attached guest
 # device) and there must be no medium inserted already.
 #
-# @id:        The name or QOM path of the guest device (since: 2.8)
+# @id:        The name or QOM path of the guest device
 #
 # @node-name: name of a node in the block driver state graph
 #
-# Note: This command is still a work in progress and is considered experimental.
-# Stay away from it unless you want to help with its development.
-#
-# Since: 2.5
+# Since: 2.12
 #
 # Example:
 #
@@ -3473,14 +3467,14 @@
 #                    "filename": "fedora.iso" } } }
 # <- { "return": {} }
 #
-# -> { "execute": "x-blockdev-insert-medium",
+# -> { "execute": "blockdev-insert-medium",
 #      "arguments": { "id": "ide0-1-0",
 #                     "node-name": "node0" } }
 #
 # <- { "return": {} }
 #
 ##
-{ 'command': 'x-blockdev-insert-medium',
+{ 'command': 'blockdev-insert-medium',
   'data': { 'id': 'str',
             'node-name': 'str'} }
 
@@ -3509,8 +3503,8 @@
 #
 # Changes the medium inserted into a block device by ejecting the current medium
 # and loading a new image file which is inserted as the new medium (this command
-# combines blockdev-open-tray, x-blockdev-remove-medium,
-# x-blockdev-insert-medium and blockdev-close-tray).
+# combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
+# and blockdev-close-tray).
 #
 # @device:          Block device name (deprecated, use @id instead)
 #
diff --git a/blockdev.c b/blockdev.c
index 2f9aef4167..8e977eef11 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2508,7 +2508,7 @@ out:
     aio_context_release(aio_context);
 }
 
-void qmp_x_blockdev_remove_medium(const char *id, Error **errp)
+void qmp_blockdev_remove_medium(const char *id, Error **errp)
 {
     blockdev_remove_medium(false, NULL, true, id, errp);
 }
@@ -2586,8 +2586,8 @@ static void blockdev_insert_medium(bool has_device, const char *device,
     qmp_blockdev_insert_anon_medium(blk, bs, errp);
 }
 
-void qmp_x_blockdev_insert_medium(const char *id, const char *node_name,
-                                  Error **errp)
+void qmp_blockdev_insert_medium(const char *id, const char *node_name,
+                                Error **errp)
 {
     blockdev_insert_medium(false, NULL, true, id, node_name, errp);
 }
diff --git a/tests/ahci-test.c b/tests/ahci-test.c
index 3635ea6d41..3934e62ef7 100644
--- a/tests/ahci-test.c
+++ b/tests/ahci-test.c
@@ -1596,7 +1596,7 @@ static void test_atapi_tray(void)
     rsp = qmp_receive();
     QDECREF(rsp);
 
-    qmp_discard_response("{'execute': 'x-blockdev-remove-medium', "
+    qmp_discard_response("{'execute': 'blockdev-remove-medium', "
                          "'arguments': {'id': 'cd0'}}");
 
     /* Test the tray without a medium */
@@ -1612,7 +1612,7 @@ static void test_atapi_tray(void)
                                         "'driver': 'raw', "
                                         "'file': { 'driver': 'file', "
                                                   "'filename': %s }}}", iso);
-    qmp_discard_response("{'execute': 'x-blockdev-insert-medium',"
+    qmp_discard_response("{'execute': 'blockdev-insert-medium',"
                           "'arguments': { 'id': 'cd0', "
                                          "'node-name': 'node0' }}");
 
diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093
index 5c36a5fb4d..c3404a3171 100755
--- a/tests/qemu-iotests/093
+++ b/tests/qemu-iotests/093
@@ -348,9 +348,9 @@ class ThrottleTestRemovableMedia(iotests.QMPTestCase):
         # Now eject cd0 and insert cd1
         result = self.vm.qmp("blockdev-open-tray", id='dev0')
         self.assert_qmp(result, 'return', {})
-        result = self.vm.qmp("x-blockdev-remove-medium", id='dev0')
+        result = self.vm.qmp("blockdev-remove-medium", id='dev0')
         self.assert_qmp(result, 'return', {})
-        result = self.vm.qmp("x-blockdev-insert-medium", id='dev0', node_name='cd1')
+        result = self.vm.qmp("blockdev-insert-medium", id='dev0', node_name='cd1')
         self.assert_qmp(result, 'return', {})
 
         # Check that the I/O limits are still the same
@@ -359,7 +359,7 @@ class ThrottleTestRemovableMedia(iotests.QMPTestCase):
         self.assert_qmp(result, 'return[0]/inserted/bps',   50)
 
         # Eject cd1
-        result = self.vm.qmp("x-blockdev-remove-medium", id='dev0')
+        result = self.vm.qmp("blockdev-remove-medium", id='dev0')
         self.assert_qmp(result, 'return', {})
 
         # Check that we can't set limits if the device has no medium
diff --git a/tests/qemu-iotests/118 b/tests/qemu-iotests/118
index ca6965d23c..a0469b570e 100755
--- a/tests/qemu-iotests/118
+++ b/tests/qemu-iotests/118
@@ -233,7 +233,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass):
         else:
             self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img)
 
-        result = self.vm.qmp('x-blockdev-remove-medium',
+        result = self.vm.qmp('blockdev-remove-medium',
                              id=self.device_name)
         self.assert_qmp(result, 'return', {})
 
@@ -242,7 +242,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass):
             self.assert_qmp(result, 'return[0]/tray_open', True)
         self.assert_qmp_absent(result, 'return[0]/inserted')
 
-        result = self.vm.qmp('x-blockdev-insert-medium',
+        result = self.vm.qmp('blockdev-insert-medium',
                              id=self.device_name, node_name='new')
         self.assert_qmp(result, 'return', {})
 
@@ -271,7 +271,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass):
         if not self.has_real_tray:
             return
 
-        result = self.vm.qmp('x-blockdev-remove-medium', id=self.device_name)
+        result = self.vm.qmp('blockdev-remove-medium', id=self.device_name)
         self.assert_qmp(result, 'error/class', 'GenericError')
 
     def test_insert_on_closed(self):
@@ -285,7 +285,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass):
                                    'driver': 'file'})
         self.assert_qmp(result, 'return', {})
 
-        result = self.vm.qmp('x-blockdev-insert-medium', id=self.device_name,
+        result = self.vm.qmp('blockdev-insert-medium', id=self.device_name,
                                                        node_name='new')
         self.assert_qmp(result, 'error/class', 'GenericError')
 
@@ -320,7 +320,7 @@ class TestInitiallyFilled(GeneralChangeTestsBaseClass):
 
         self.wait_for_open()
 
-        result = self.vm.qmp('x-blockdev-insert-medium', id=self.device_name,
+        result = self.vm.qmp('blockdev-insert-medium', id=self.device_name,
                                                        node_name='new')
         self.assert_qmp(result, 'error/class', 'GenericError')
 
@@ -345,7 +345,7 @@ class TestInitiallyEmpty(GeneralChangeTestsBaseClass):
 
         self.wait_for_open()
 
-        result = self.vm.qmp('x-blockdev-remove-medium', id=self.device_name)
+        result = self.vm.qmp('blockdev-remove-medium', id=self.device_name)
         # Should be a no-op
         self.assert_qmp(result, 'return', {})
 
@@ -603,13 +603,13 @@ class TestChangeReadOnly(ChangeBaseClass):
         self.assert_qmp(result, 'return[0]/inserted/ro', False)
         self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img)
 
-        result = self.vm.qmp('x-blockdev-remove-medium', id=self.device_name)
+        result = self.vm.qmp('blockdev-remove-medium', id=self.device_name)
         self.assert_qmp(result, 'return', {})
 
         result = self.vm.qmp('query-block')
         self.assert_qmp_absent(result, 'return[0]/inserted')
 
-        result = self.vm.qmp('x-blockdev-insert-medium', id=self.device_name,
+        result = self.vm.qmp('blockdev-insert-medium', id=self.device_name,
                                                        node_name='new')
         self.assert_qmp(result, 'return', {})
 
@@ -642,7 +642,7 @@ class TestBlockJobsAfterCycle(ChangeBaseClass):
 
         # For device-less BBs, calling blockdev-open-tray or blockdev-close-tray
         # is not necessary
-        result = self.vm.qmp('x-blockdev-remove-medium', id=self.device_name)
+        result = self.vm.qmp('blockdev-remove-medium', id=self.device_name)
         self.assert_qmp(result, 'return', {})
 
         result = self.vm.qmp('query-block')
@@ -655,7 +655,7 @@ class TestBlockJobsAfterCycle(ChangeBaseClass):
                                    'driver': 'file'})
         self.assert_qmp(result, 'return', {})
 
-        result = self.vm.qmp('x-blockdev-insert-medium', id=self.device_name,
+        result = self.vm.qmp('blockdev-insert-medium', id=self.device_name,
                                                        node_name='node0')
         self.assert_qmp(result, 'return', {})
 
diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139
index f8f02808a9..cc7fe337f3 100644
--- a/tests/qemu-iotests/139
+++ b/tests/qemu-iotests/139
@@ -133,7 +133,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
     # Insert a BlockDriverState
     def insertDrive(self, device, node):
         self.checkBlockDriverState(node)
-        result = self.vm.qmp('x-blockdev-insert-medium',
+        result = self.vm.qmp('blockdev-insert-medium',
                              id = device, node_name = node)
         self.assert_qmp(result, 'return', {})
         self.checkBlockDriverState(node)
-- 
2.13.6

  parent reply	other threads:[~2018-01-23 14:02 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23 14:01 [Qemu-devel] [PULL 00/29] Block layer patches Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 01/29] osdep: Retry SETLK upon EINTR Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 02/29] hw/block: Fix pin-based interrupt behaviour of NVMe Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 03/29] tests/.gitignore: Add test-bdrv-drain Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 04/29] tests/qemu-iotests: adding savevm/loadvm with postcopy flag test Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 05/29] qcow2: Repair unaligned preallocated zero clusters Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 06/29] iotests: Make BD-{remove, insert}-medium use @id Kevin Wolf
2018-02-12 11:16   ` Christian Borntraeger
2018-02-12 11:33     ` Christian Borntraeger
2018-02-12 12:34       ` Max Reitz
2018-01-23 14:01 ` [Qemu-devel] [PULL 07/29] tests/ahci: Switch tray and medium commands to @id Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 08/29] blockdev: Drop BD-{remove, insert}-medium's @device Kevin Wolf
2018-01-23 14:01 ` Kevin Wolf [this message]
2018-01-23 14:01 ` [Qemu-devel] [PULL 10/29] qemu-iotests: Fix locking issue in 102 Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 11/29] block/vmdk: Fix , instead of ; at end of line Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 12/29] qcow2: No persistent dirty bitmaps for compat=0.10 Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 13/29] block/qcow: Add blkdebug events Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 14/29] block/vmdk: " Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 15/29] iotests: Fix _img_info for backslashes Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 16/29] iotests: Drop format-specific in _filter_img_info Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 17/29] iotests: Forbid 020 for non-file protocols Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 18/29] iotests: Skip 103 for refcount_bits=1 Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 19/29] iotests: Fix 020 for vmdk Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 20/29] iotests: Fix 051 for compat=0.10 Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 21/29] iotests: Fix 059's reference output Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 22/29] iotests: Fix 067 for compat=0.10 Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 23/29] iotests: Make 089 compatible with compat=0.10 Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 24/29] iotests: Make 184 image-less Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 25/29] iotests: Make 191 work with qcow2 options Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 26/29] iotests: Filter compat-dependent info in 198 Kevin Wolf
2018-01-23 14:01 ` [Qemu-devel] [PULL 27/29] iotests: Make 059 pass on machines with little RAM Kevin Wolf
2018-01-23 14:02 ` [Qemu-devel] [PULL 28/29] iotests: Split 177 into two parts for compat=0.10 Kevin Wolf
2018-01-23 14:02 ` [Qemu-devel] [PULL 29/29] iotests: Disable some tests " Kevin Wolf
2018-01-25  9:53 ` [Qemu-devel] [PULL 00/29] Block layer patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180123140201.31163-10-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.