From nobody Mon Apr 29 00:13:59 2024 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.zoho.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 1490115527897780.1953790667777; Tue, 21 Mar 2017 09:58:47 -0700 (PDT) Received: from localhost ([::1]:41481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqN7O-0002Ha-25 for importer@patchew.org; Tue, 21 Mar 2017 12:58:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqN6d-0001vK-Vb for qemu-devel@nongnu.org; Tue, 21 Mar 2017 12:58:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cqN6a-0005ZN-R3 for qemu-devel@nongnu.org; Tue, 21 Mar 2017 12:58:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47834) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cqN6a-0005YH-JX for qemu-devel@nongnu.org; Tue, 21 Mar 2017 12:57:56 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 60CE17AEA1 for ; Tue, 21 Mar 2017 16:57:56 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F20D07FB42; Tue, 21 Mar 2017 16:57:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4D7A21138645; Tue, 21 Mar 2017 17:57:53 +0100 (CET) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 60CE17AEA1 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 60CE17AEA1 From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 21 Mar 2017 17:57:53 +0100 Message-Id: <1490115473-24839-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 21 Mar 2017 16:57:56 +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] [PATCH for-2.9] block: Declare blockdev-add and blockdev-del supported 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, pkrempa@redhat.com, mreitz@redhat.com 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" 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 Reviewed-by: Eric Blake --- 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/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) =20 bs =3D 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); } =20 -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 } =20 ## -# @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' } } =20 ## # @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 @@ -79,7 +79,7 @@ class TestBlockdevDel(iotests.QMPTestCase): # Delete a BlockDriverState def delBlockDriverState(self, node, expect_error =3D False): self.checkBlockDriverState(node) - result =3D self.vm.qmp('x-blockdev-del', node_name =3D node) + result =3D self.vm.qmp('blockdev-del', node_name =3D 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) =20 # 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) =20 # 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() =20 # We want this to return an error because the block job is still runni= ng _send_qemu_cmd $QEMU_HANDLE \ - "{'execute': 'x-blockdev-del', + "{'execute': 'blockdev-del', 'arguments': {'node-name': 'drv0'}}" \ 'error' | _filter_generated_node_ids =20 @@ -75,7 +75,7 @@ test_blockjob() "$3" =20 _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 =20 - result =3D self.vm.qmp('x-blockdev-del', node_name=3D'nbd-blockdev= ') + result =3D self.vm.qmp('blockdev-del', node_name=3D'nbd-blockdev') self.assert_qmp(result, 'return', {}) =20 =20 --=20 2.7.4