From nobody Wed Apr 16 12:17:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516717209037138.32390134463014; Tue, 23 Jan 2018 06:20:09 -0800 (PST) Received: from localhost ([::1]:60021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzQm-0001SW-6R for importer@patchew.org; Tue, 23 Jan 2018 09:20:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9w-0003dL-99 for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9p-0005vY-J7 for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46074) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9Y-0005jh-Ew; Tue, 23 Jan 2018 09:02:20 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8A1BC7CB9C; Tue, 23 Jan 2018 14:02:19 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A24EBA79; Tue, 23 Jan 2018 14:02:18 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:41 +0100 Message-Id: <20180123140201.31163-10-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 23 Jan 2018 14:02:19 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 09/29] blockdev: Mark BD-{remove, insert}-medium stable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz 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 Message-id: 20171110224302.14424-5-mreitz@redhat.com Reviewed-by: Alberto Garcia Signed-off-by: Max Reitz --- 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' } } =20 ## -# @x-blockdev-remove-medium: +# @blockdev-remove-medium: # # Removes a medium (a block driver state tree) from a block device. That b= lock # 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-o= p. # -# @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 experim= ental. -# 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' } } =20 ## -# @x-blockdev-insert-medium: +# @blockdev-insert-medium: # # Inserts a medium (a block driver state tree) into a block device. That b= lock # 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 experim= ental. -# 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'} } =20 @@ -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 c= ommand -# 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-med= ium +# 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); } =20 -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, c= onst char *device, qmp_blockdev_insert_anon_medium(blk, bs, errp); } =20 -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 =3D qmp_receive(); QDECREF(rsp); =20 - qmp_discard_response("{'execute': 'x-blockdev-remove-medium', " + qmp_discard_response("{'execute': 'blockdev-remove-medium', " "'arguments': {'id': 'cd0'}}"); =20 /* Test the tray without a medium */ @@ -1612,7 +1612,7 @@ static void test_atapi_tray(void) "'driver': 'raw', " "'file': { 'driver': 'file', " "'filename': %s }}}", is= o); - qmp_discard_response("{'execute': 'x-blockdev-insert-medium'," + qmp_discard_response("{'execute': 'blockdev-insert-medium'," "'arguments': { 'id': 'cd0', " "'node-name': 'node0' }}"); =20 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 =3D self.vm.qmp("blockdev-open-tray", id=3D'dev0') self.assert_qmp(result, 'return', {}) - result =3D self.vm.qmp("x-blockdev-remove-medium", id=3D'dev0') + result =3D self.vm.qmp("blockdev-remove-medium", id=3D'dev0') self.assert_qmp(result, 'return', {}) - result =3D self.vm.qmp("x-blockdev-insert-medium", id=3D'dev0', no= de_name=3D'cd1') + result =3D self.vm.qmp("blockdev-insert-medium", id=3D'dev0', node= _name=3D'cd1') self.assert_qmp(result, 'return', {}) =20 # 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) =20 # Eject cd1 - result =3D self.vm.qmp("x-blockdev-remove-medium", id=3D'dev0') + result =3D self.vm.qmp("blockdev-remove-medium", id=3D'dev0') self.assert_qmp(result, 'return', {}) =20 # 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', o= ld_img) =20 - result =3D self.vm.qmp('x-blockdev-remove-medium', + result =3D self.vm.qmp('blockdev-remove-medium', id=3Dself.device_name) self.assert_qmp(result, 'return', {}) =20 @@ -242,7 +242,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.assert_qmp(result, 'return[0]/tray_open', True) self.assert_qmp_absent(result, 'return[0]/inserted') =20 - result =3D self.vm.qmp('x-blockdev-insert-medium', + result =3D self.vm.qmp('blockdev-insert-medium', id=3Dself.device_name, node_name=3D'new') self.assert_qmp(result, 'return', {}) =20 @@ -271,7 +271,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): if not self.has_real_tray: return =20 - result =3D self.vm.qmp('x-blockdev-remove-medium', id=3Dself.devic= e_name) + result =3D self.vm.qmp('blockdev-remove-medium', id=3Dself.device_= name) self.assert_qmp(result, 'error/class', 'GenericError') =20 def test_insert_on_closed(self): @@ -285,7 +285,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): 'driver': 'file'}) self.assert_qmp(result, 'return', {}) =20 - result =3D self.vm.qmp('x-blockdev-insert-medium', id=3Dself.devic= e_name, + result =3D self.vm.qmp('blockdev-insert-medium', id=3Dself.device_= name, node_name=3D'new') self.assert_qmp(result, 'error/class', 'GenericError') =20 @@ -320,7 +320,7 @@ class TestInitiallyFilled(GeneralChangeTestsBaseClass): =20 self.wait_for_open() =20 - result =3D self.vm.qmp('x-blockdev-insert-medium', id=3Dself.devic= e_name, + result =3D self.vm.qmp('blockdev-insert-medium', id=3Dself.device_= name, node_name=3D'new') self.assert_qmp(result, 'error/class', 'GenericError') =20 @@ -345,7 +345,7 @@ class TestInitiallyEmpty(GeneralChangeTestsBaseClass): =20 self.wait_for_open() =20 - result =3D self.vm.qmp('x-blockdev-remove-medium', id=3Dself.devic= e_name) + result =3D self.vm.qmp('blockdev-remove-medium', id=3Dself.device_= name) # Should be a no-op self.assert_qmp(result, 'return', {}) =20 @@ -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_i= mg) =20 - result =3D self.vm.qmp('x-blockdev-remove-medium', id=3Dself.devic= e_name) + result =3D self.vm.qmp('blockdev-remove-medium', id=3Dself.device_= name) self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('query-block') self.assert_qmp_absent(result, 'return[0]/inserted') =20 - result =3D self.vm.qmp('x-blockdev-insert-medium', id=3Dself.devic= e_name, + result =3D self.vm.qmp('blockdev-insert-medium', id=3Dself.device_= name, node_name=3D'new') self.assert_qmp(result, 'return', {}) =20 @@ -642,7 +642,7 @@ class TestBlockJobsAfterCycle(ChangeBaseClass): =20 # For device-less BBs, calling blockdev-open-tray or blockdev-clos= e-tray # is not necessary - result =3D self.vm.qmp('x-blockdev-remove-medium', id=3Dself.devic= e_name) + result =3D self.vm.qmp('blockdev-remove-medium', id=3Dself.device_= name) self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('query-block') @@ -655,7 +655,7 @@ class TestBlockJobsAfterCycle(ChangeBaseClass): 'driver': 'file'}) self.assert_qmp(result, 'return', {}) =20 - result =3D self.vm.qmp('x-blockdev-insert-medium', id=3Dself.devic= e_name, + result =3D self.vm.qmp('blockdev-insert-medium', id=3Dself.device_= name, node_name=3D'node0') self.assert_qmp(result, 'return', {}) =20 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 =3D self.vm.qmp('x-blockdev-insert-medium', + result =3D self.vm.qmp('blockdev-insert-medium', id =3D device, node_name =3D node) self.assert_qmp(result, 'return', {}) self.checkBlockDriverState(node) --=20 2.13.6