From patchwork Wed May 10 08:41:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pradeep X-Patchwork-Id: 9719497 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 3EC60601E7 for ; Wed, 10 May 2017 08:45:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36E0E284E4 for ; Wed, 10 May 2017 08:45:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AF5028558; Wed, 10 May 2017 08:45:54 +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 4A782284E4 for ; Wed, 10 May 2017 08:45:53 +0000 (UTC) Received: from localhost ([::1]:41149 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8NFo-0007kD-Ie for patchwork-qemu-devel@patchwork.kernel.org; Wed, 10 May 2017 04:45:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8NCZ-0005Zn-Sd for qemu-devel@nongnu.org; Wed, 10 May 2017 04:42:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d8NCY-0007DW-Ev for qemu-devel@nongnu.org; Wed, 10 May 2017 04:42:31 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:36459) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d8NCY-0007DG-59 for qemu-devel@nongnu.org; Wed, 10 May 2017 04:42:30 -0400 Received: by mail-wr0-x241.google.com with SMTP id v42so6323259wrc.3 for ; Wed, 10 May 2017 01:42:30 -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=RjStfD+hmelHWNosBEklKfl46zz1AykuluL/cUVTY0o=; b=NbXqafCtPowW0KLwkxZWwE0rI+XsK6BLJlwP08fr4SasopeZKA7x8TJJqWBCaWHtr9 65j+reKoVWhzW3c17Mn2r2AgiQAbDcbcovtgEiXz2LCWS/+dioHeVtPrO4+uXELAlwSq g2jbBJFVwMvq4UHj4nrkGRQ+h2ViHI0l6aaaE+Sgkj/7sKFGSSjM1BiuhhzNjft/+C9Z iItqRsi1Ol7W2AmhHJ1z1RCmC4xa1pjJdIjay0GlsfiHAsv86yOu+kwGxNQphNo1IUZN /GcE7XypV+XbcOI975DGxbHcFnNu/HmIEvWJnRlsYsdXGzavycXqfZRu0+XAyQnJwCI2 WEZw== 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=RjStfD+hmelHWNosBEklKfl46zz1AykuluL/cUVTY0o=; b=TGIZ+BpGV1Qi6xWFr7EJJ+3CV2FW5INnaNP8qS16+/I9Kf8yEv/Un1hq4D7ZhKPQ65 MdJ8XMrJRTp86Jn0UaJQ3B8+xC5ZpVcCwLR23/8pctE7zEFC0XNL5C/pusebOQDlZp34 6/1hAPJlvctFSHOIGVE4sjqxlGK5tQU+lV8O8ShJWX5PYGdyAsuUmIKBUN8BimJvqMU9 ifLIh3mS5QRU5cpfYL22MZgEcxBvChV1Zgr6kyaWAdfGxzgTKKzjlkh3KWktWAEb4TbX ho6zUUOqCwq0M99IETRgvQuuA91V40EQGTPISsXuDdpQdlOXEs3bPnKkHA9DW2V4Q3aO cPQQ== X-Gm-Message-State: AODbwcDw+A2nNYpGVXwtoedyzEtkvO9FwKpUu+M9vY23d5VBq5Emgr3u CcoyofNyjyRKGw== X-Received: by 10.28.30.145 with SMTP id e139mr215995wme.129.1494405749024; Wed, 10 May 2017 01:42:29 -0700 (PDT) Received: from centos-minion-1.localdomain ([217.110.131.66]) by smtp.gmail.com with ESMTPSA id y63sm4300148wme.31.2017.05.10.01.42.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 May 2017 01:42:28 -0700 (PDT) From: Pradeep Jagadeesh X-Google-Original-From: Pradeep Jagadeesh To: "eric blake" , "greg kurz" Date: Wed, 10 May 2017 04:41:21 -0400 Message-Id: <1494405683-20877-3-git-send-email-pradeep.jagadeesh@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1494405683-20877-1-git-send-email-pradeep.jagadeesh@huawei.com> References: <1494405683-20877-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:c0c::241 Subject: [Qemu-devel] [PATCH v4 2/4] qmp: Create IOThrottle 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 enables qmp interfaces for the fsdev devices. This provides two interfaces one for querying info of all the fsdev devices. The second one to set the IO limits for the required fsdev device. Signed-off-by: Pradeep Jagadeesh Reviewed-by: Greg Kurz Reviewed-by: Eric Blake --- qapi/block-core.json | 76 ++------------------------------------------- qapi/iothrottle.json | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 73 deletions(-) create mode 100644 qapi/iothrottle.json diff --git a/qapi/block-core.json b/qapi/block-core.json index 87fb747..93d346b 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -6,6 +6,7 @@ # QAPI common definitions { 'include': 'common.json' } +{ 'include': 'iothrottle.json' } ## # @SnapshotInfo: @@ -1760,84 +1761,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': 'IOThrottle', + 'data': { '*device': 'str', '*group': 'str' } } ## # @block-stream: diff --git a/qapi/iothrottle.json b/qapi/iothrottle.json new file mode 100644 index 0000000..0f067c3 --- /dev/null +++ b/qapi/iothrottle.json @@ -0,0 +1,88 @@ +# -*- Mode: Python -*- + +## +# == QAPI IOThrottle definitions +## + +## +# @IOThrottle: +# +# A set of parameters describing IO throttling +# +# @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) +# +# +# Since: 2.10 +## +{ 'struct': 'IOThrottle', + 'data': { '*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' } }