From patchwork Thu Sep 14 10:40:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pradeep X-Patchwork-Id: 9952757 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DD20F60317 for ; Thu, 14 Sep 2017 10:41:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA9B828E92 for ; Thu, 14 Sep 2017 10:41:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AEFE128E9D; Thu, 14 Sep 2017 10:41:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 27CF728E92 for ; Thu, 14 Sep 2017 10:41:55 +0000 (UTC) Received: from localhost ([::1]:46865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsRak-0006sE-9l for patchwork-qemu-devel@patchwork.kernel.org; Thu, 14 Sep 2017 06:41:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsRZh-0006pr-IK for qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:40:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dsRZd-0001wt-0I for qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:40:49 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:38267) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dsRZc-0001vu-Gd for qemu-devel@nongnu.org; Thu, 14 Sep 2017 06:40:44 -0400 Received: by mail-wm0-x242.google.com with SMTP id x17so2867582wmd.5 for ; Thu, 14 Sep 2017 03:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1x16PabO960ttIVHJ5euH4mKWmdMjRWOyXL9dHWHGcE=; b=M+uV3M5p5Z1XaUDjy6W+GeSAler1KB547bqLOYkvBya8aMVSdyAjTY4CELmCc4mYzR UUFUdWKZnhJFnqm48Xrj3i9ZTVdO489oFNvHRcyVutGexj5SxsRnKXhctn7CllBdPFfL o3wOfEEjuDejucEAaV4pEKmp2kaFfTsX0wPBZL3OpmsBh27k2LyEClwtDaJi4r7Y5QZI ZcR2uWFo7fWtvE3ZCMANYXpVX12rcUZ70eRuujcFTqKsPQGLmU6+NH3DId/gjzlOE8OH x7mj1/mH5hokooRJNu9QIiXeEP2QZSWS157lqulA3H7Jf9np0jv0OI1KkavFBn9d2e9G wFqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1x16PabO960ttIVHJ5euH4mKWmdMjRWOyXL9dHWHGcE=; b=QjskGbCDPZidXtMMqg9YOPwNz7cCVinVVGEX8XP7fY76cyGHofUcxl2SKVJC4sb2S9 3TMzmWVG81gHIItirUwpCBSRFGzd57rxPUIHAENs+aBPO9cNORWgvcML6ihD8NPQQ5pQ bSZ6k37gfqyiFjgyD9V8o7UFt7oWfF0QVhTe5CxCcUoIgNkzEtGQLWx2obkm+XGW85OW cjc0Dl3YN6RNkI7bEWnJi6BRtIMajaY9DwmRYMmWkNZfcBGa8Wx7GHVAKa4qtHWQsOrU fYPXmzt6LzE/msA9Cjo/D6UkmiARIN+NAMYwxSEMNYCSSpb3vheu4zmNrjeBPLOmrpov Jjkw== X-Gm-Message-State: AHPjjUiTR2dR5s2jlnJTwYhGgpgBdZIDZK6yCL2gpYrkYpxZi3UBSrpk /ygOLsT5Ha0U7w== X-Google-Smtp-Source: AOwi7QAOIpTrJzLl4Z5ML1LMB4tT+0goeNCh/cXAvjT5lCrSiMMxhVbIBh7CaIZccNKk9WxzTTFv7A== X-Received: by 10.28.164.68 with SMTP id n65mr1463066wme.23.1505385643398; Thu, 14 Sep 2017 03:40:43 -0700 (PDT) Received: from localhost.localdomain.localdomain ([217.110.131.66]) by smtp.gmail.com with ESMTPSA id w14sm742801wmf.13.2017.09.14.03.40.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Sep 2017 03:40:42 -0700 (PDT) From: Pradeep Jagadeesh X-Google-Original-From: Pradeep Jagadeesh To: "eric blake" , "greg kurz" Date: Thu, 14 Sep 2017 06:40:06 -0400 Message-Id: <1505385610-35529-3-git-send-email-pradeep.jagadeesh@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1505385610-35529-1-git-send-email-pradeep.jagadeesh@huawei.com> References: <1505385610-35529-1-git-send-email-pradeep.jagadeesh@huawei.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PATCH v11 2/6] qmp: Use ThrottleLimits structure 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: jani kokkonen , alberto garcia , Pradeep Jagadeesh , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch factors out code to use the ThrottleLimits strurcture. Signed-off-by: Pradeep Jagadeesh Reviewed-by: Greg Kurz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia Reviewed-by: Markus Armbruster --- qapi/block-core.json | 78 +++------------------------------------------------- 1 file changed, 4 insertions(+), 74 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index bb11815..d0ccfda 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1826,84 +1826,13 @@ # # @device: Block device name (deprecated, use @id instead) # -# @id: The name or QOM path of the guest device (since: 2.8) -# -# @bps: total throughput limit in bytes per second -# -# @bps_rd: read throughput limit in bytes per second -# -# @bps_wr: write throughput limit in bytes per second -# -# @iops: total I/O operations per second -# -# @iops_rd: read I/O operations per second -# -# @iops_wr: write I/O operations per second -# -# @bps_max: total throughput limit during bursts, -# in bytes (Since 1.7) -# -# @bps_rd_max: read throughput limit during bursts, -# in bytes (Since 1.7) -# -# @bps_wr_max: write throughput limit during bursts, -# in bytes (Since 1.7) -# -# @iops_max: total I/O operations per second during bursts, -# in bytes (Since 1.7) -# -# @iops_rd_max: read I/O operations per second during bursts, -# in bytes (Since 1.7) -# -# @iops_wr_max: write I/O operations per second during bursts, -# in bytes (Since 1.7) -# -# @bps_max_length: maximum length of the @bps_max burst -# period, in seconds. It must only -# be set if @bps_max is set as well. -# Defaults to 1. (Since 2.6) -# -# @bps_rd_max_length: maximum length of the @bps_rd_max -# burst period, in seconds. It must only -# be set if @bps_rd_max is set as well. -# Defaults to 1. (Since 2.6) -# -# @bps_wr_max_length: maximum length of the @bps_wr_max -# burst period, in seconds. It must only -# be set if @bps_wr_max is set as well. -# Defaults to 1. (Since 2.6) -# -# @iops_max_length: maximum length of the @iops burst -# period, in seconds. It must only -# be set if @iops_max is set as well. -# Defaults to 1. (Since 2.6) -# -# @iops_rd_max_length: maximum length of the @iops_rd_max -# burst period, in seconds. It must only -# be set if @iops_rd_max is set as well. -# Defaults to 1. (Since 2.6) -# -# @iops_wr_max_length: maximum length of the @iops_wr_max -# burst period, in seconds. It must only -# be set if @iops_wr_max is set as well. -# Defaults to 1. (Since 2.6) -# -# @iops_size: an I/O size in bytes (Since 1.7) -# # @group: throttle group name (Since 2.4) # # Since: 1.1 ## { 'struct': 'BlockIOThrottle', - 'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int', - 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int', - '*bps_max': 'int', '*bps_rd_max': 'int', - '*bps_wr_max': 'int', '*iops_max': 'int', - '*iops_rd_max': 'int', '*iops_wr_max': 'int', - '*bps_max_length': 'int', '*bps_rd_max_length': 'int', - '*bps_wr_max_length': 'int', '*iops_max_length': 'int', - '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int', - '*iops_size': 'int', '*group': 'str' } } + 'base': 'ThrottleLimits', + 'data': { '*device': 'str', '*group': 'str' } } ## # @ThrottleLimits: @@ -1913,6 +1842,7 @@ # transaction. All fields are optional. When setting limits, if a field is # missing the current value is not changed. # +# @id: device id # @iops-total: limit total I/O operations per second # @iops-total-max: I/O operations burst # @iops-total-max-length: length of the iops-total-max burst period, in seconds @@ -1942,7 +1872,7 @@ # Since: 2.11 ## { 'struct': 'ThrottleLimits', - 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int', + 'data': { '*id' : 'str', '*iops-total' : 'int', '*iops-total-max' : 'int', '*iops-total-max-length' : 'int', '*iops-read' : 'int', '*iops-read-max' : 'int', '*iops-read-max-length' : 'int', '*iops-write' : 'int', '*iops-write-max' : 'int',