From patchwork Fri Feb 5 10:59:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 579435 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 0FBA31402C9 for ; Fri, 5 Feb 2016 22:02:45 +1100 (AEDT) Received: from localhost ([::1]:47493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRe9z-0003I0-3X for incoming@patchwork.ozlabs.org; Fri, 05 Feb 2016 06:02:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRe9O-00028g-Fw for qemu-devel@nongnu.org; Fri, 05 Feb 2016 06:02:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRe9N-0003yk-FL for qemu-devel@nongnu.org; Fri, 05 Feb 2016 06:02:06 -0500 Received: from smtp3.mundo-r.com ([212.51.32.191]:14685 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRe9N-0003fw-9R; Fri, 05 Feb 2016 06:02:05 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CoAgAzgLRW/5tjdVteGQEBAQEPAQEBAY0ksQ0NgWaGDQKBODgUAQEBAQEBAYEKhEIBBXkQPxI8GxmIHwHAB4gHiy4FjSaJTY1QgVuHaYUvjj8eAkKCAByBSopkAQEB X-IPAS-Result: A2CoAgAzgLRW/5tjdVteGQEBAQEPAQEBAY0ksQ0NgWaGDQKBODgUAQEBAQEBAYEKhEIBBXkQPxI8GxmIHwHAB4gHiy4FjSaJTY1QgVuHaYUvjj8eAkKCAByBSopkAQEB X-IronPort-AV: E=Sophos;i="5.22,399,1449529200"; d="scan'208";a="81163418" Received: from fanzine.igalia.com ([91.117.99.155]) by smtp4.mundo-r.com with ESMTP; 05 Feb 2016 11:59:48 +0100 Received: from dsl-hkibrasgw4-50df50-201.dhcp.inet.fi ([80.223.80.201] helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim) id 1aRe78-0007eU-NG; Fri, 05 Feb 2016 11:59:47 +0100 Received: from berto by perseus.local with local (Exim 4.86) (envelope-from ) id 1aRe6v-0007dd-Hd; Fri, 05 Feb 2016 12:59:33 +0200 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Fri, 5 Feb 2016 12:59:19 +0200 Message-Id: <7fcab26ca473da5710bded6bd822903015ac6e43.1454669823.git.berto@igalia.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.51.32.191 Cc: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, Markus Armbruster , Max Reitz , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 09/13] throttle: Add command-line settings to define the burst periods X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patch adds all the throttling.*-max-length command-line parameters to define the length of the burst periods. Signed-off-by: Alberto Garcia --- blockdev.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/blockdev.c b/blockdev.c index c9e91ab..5a2a9b4 100644 --- a/blockdev.c +++ b/blockdev.c @@ -414,6 +414,19 @@ static void extract_common_blockdev_options(QemuOpts *opts, int *bdrv_flags, throttle_cfg->buckets[THROTTLE_OPS_WRITE].max = qemu_opt_get_number(opts, "throttling.iops-write-max", 0); + throttle_cfg->buckets[THROTTLE_BPS_TOTAL].burst_length = + qemu_opt_get_number(opts, "throttling.bps-total-max-length", 1); + throttle_cfg->buckets[THROTTLE_BPS_READ].burst_length = + qemu_opt_get_number(opts, "throttling.bps-read-max-length", 1); + throttle_cfg->buckets[THROTTLE_BPS_WRITE].burst_length = + qemu_opt_get_number(opts, "throttling.bps-write-max-length", 1); + throttle_cfg->buckets[THROTTLE_OPS_TOTAL].burst_length = + qemu_opt_get_number(opts, "throttling.iops-total-max-length", 1); + throttle_cfg->buckets[THROTTLE_OPS_READ].burst_length = + qemu_opt_get_number(opts, "throttling.iops-read-max-length", 1); + throttle_cfg->buckets[THROTTLE_OPS_WRITE].burst_length = + qemu_opt_get_number(opts, "throttling.iops-write-max-length", 1); + throttle_cfg->op_size = qemu_opt_get_number(opts, "throttling.iops-size", 0); @@ -4064,6 +4077,30 @@ QemuOptsList qemu_common_drive_opts = { .type = QEMU_OPT_NUMBER, .help = "total bytes write burst", },{ + .name = "throttling.iops-total-max-length", + .type = QEMU_OPT_NUMBER, + .help = "length of the iops-total-max burst period, in seconds", + },{ + .name = "throttling.iops-read-max-length", + .type = QEMU_OPT_NUMBER, + .help = "length of the iops-read-max burst period, in seconds", + },{ + .name = "throttling.iops-write-max-length", + .type = QEMU_OPT_NUMBER, + .help = "length of the iops-write-max burst period, in seconds", + },{ + .name = "throttling.bps-total-max-length", + .type = QEMU_OPT_NUMBER, + .help = "length of the bps-total-max burst period, in seconds", + },{ + .name = "throttling.bps-read-max-length", + .type = QEMU_OPT_NUMBER, + .help = "length of the bps-read-max burst period, in seconds", + },{ + .name = "throttling.bps-write-max-length", + .type = QEMU_OPT_NUMBER, + .help = "length of the bps-write-max burst period, in seconds", + },{ .name = "throttling.iops-size", .type = QEMU_OPT_NUMBER, .help = "when limiting by iops max size of an I/O in bytes",