From patchwork Mon Jan 22 12:40:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 864248 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zQB1H2BHNz9ryk for ; Mon, 22 Jan 2018 23:43:15 +1100 (AEDT) Received: from localhost ([::1]:40021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edbRR-0000tt-2u for incoming@patchwork.ozlabs.org; Mon, 22 Jan 2018 07:43:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edbPF-00087s-6c for qemu-devel@nongnu.org; Mon, 22 Jan 2018 07:40:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edbPC-0002c4-W6 for qemu-devel@nongnu.org; Mon, 22 Jan 2018 07:40:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51616) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edbPC-0002be-PZ for qemu-devel@nongnu.org; Mon, 22 Jan 2018 07:40:54 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E4545C07015A; Mon, 22 Jan 2018 12:40:53 +0000 (UTC) Received: from localhost (ovpn-116-110.ams2.redhat.com [10.36.116.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 761C57A2F6; Mon, 22 Jan 2018 12:40:53 +0000 (UTC) From: Stefan Hajnoczi To: Date: Mon, 22 Jan 2018 12:40:33 +0000 Message-Id: <20180122124033.21440-3-stefanha@redhat.com> In-Reply-To: <20180122124033.21440-1-stefanha@redhat.com> References: <20180122124033.21440-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 22 Jan 2018 12:40:53 +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 2/2] block: add block_set_io_throttle virtio-blk-pci QMP example 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: Kevin Wolf , Peter Maydell , Stefan Hajnoczi Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The block_set_io_throttle command can look up BlockBackends by the attached qdev device ID. virtio-blk-pci is a special case because the actual VirtIOBlock device is the "/virtio-backend" child of the PCI adapter device. Add a QMP schema example so clients will know how to use block_set_io_throttle on the virtio-blk-pci device. The alternative is to implement some sort of aliasing for qmp_get_blk() but that is likely to cause confusion and could break future use cases. Let's not go there. Cc: Kevin Wolf Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Message-id: 20180117090700.25811-1-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- qapi/block-core.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/qapi/block-core.json b/qapi/block-core.json index e94a6881b2..4e84cf29db 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1799,6 +1799,24 @@ # Example: # # -> { "execute": "block_set_io_throttle", +# "arguments": { "id": "virtio-blk-pci0/virtio-backend", +# "bps": 0, +# "bps_rd": 0, +# "bps_wr": 0, +# "iops": 512, +# "iops_rd": 0, +# "iops_wr": 0, +# "bps_max": 0, +# "bps_rd_max": 0, +# "bps_wr_max": 0, +# "iops_max": 0, +# "iops_rd_max": 0, +# "iops_wr_max": 0, +# "bps_max_length": 0, +# "iops_size": 0 } } +# <- { "return": {} } +# +# -> { "execute": "block_set_io_throttle", # "arguments": { "id": "ide0-1-0", # "bps": 1000000, # "bps_rd": 0,