From nobody Wed May 1 17:05:28 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@gnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@gnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506949333832581.5332378032557; Mon, 2 Oct 2017 06:02:13 -0700 (PDT) Received: from localhost ([::1]:52189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dz0MN-00022x-2Q for importer@patchew.org; Mon, 02 Oct 2017 09:02:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dz0LN-0001UL-BD for qemu-devel@nongnu.org; Mon, 02 Oct 2017 09:01:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dz0LH-0004KV-MH for qemu-devel@nongnu.org; Mon, 02 Oct 2017 09:01:09 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:55731) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dz0LH-0004JZ-Fo for qemu-devel@nongnu.org; Mon, 02 Oct 2017 09:01:03 -0400 Received: by mail-wm0-x244.google.com with SMTP id u138so10419544wmu.4 for ; Mon, 02 Oct 2017 06:01:02 -0700 (PDT) Received: from localhost.localdomain.localdomain ([217.110.131.66]) by smtp.gmail.com with ESMTPSA id f13sm4302674wre.66.2017.10.02.06.00.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Oct 2017 06:00:59 -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; bh=WWNq47fLAzXCjd+IaRB8gMMEhcD9fd+IVNW+OzH9k3g=; b=oxxtLaAPm6gqbSZfxivsmZPR4j1hMAvUeIgHHF/R2QMPJqZ7jrSxr0TH2j7TtBh1ls zqNf3FdYD39T6Zbi+xNGdGUjK7BjeQoLqAjsXTIiZs7eAtymqhzeAWXavWnM26Zp0Ke4 ollqs3W+X1qf1O7Vx0zys6nveXh8pQvEmIxO+o8rosMRYLlexAfWx0IKSXga69x8uqp+ kPv84DDp3iSQz8gaDvG1+oRnkpSjn7aie2P/i0TVOMyFo+yATL799ipySVln6D5yp/wz NqRSw56v1XECPTRuq11qR+yMRqoWz1B/XIhnC23/401c5FPPT5Sg6NLE8C0qnBVuoRhV MVQw== 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; bh=WWNq47fLAzXCjd+IaRB8gMMEhcD9fd+IVNW+OzH9k3g=; b=DUVRad8pNCyfOVGZV1eJKkqOfm+2O0L/uSizvRH7kRaHiON1buIsEG5B5oiTCXiNut cmKTvbNEvoEx9hLZD9q4jqdvU37UrdiA43htlqs/ECiQfuuiUQTDyrO46+0/mZrbJdHA wT06pgLmwA6u/76rx/MZiaZqY/SlKE+WvcgQqBf5whdkAw/CErPI7NrQGUdYWc6Jc6tg ySbeMQGCKH+qq9gnc0GHcvwqlFaL4bZk/jcoCxhLQiAYvzKl+F3/xusssWnIjZ004+0n AplzEg/r3EmBpRlM9K586Cb5wX+V4So2qb0Ew5goRpzqtrdMKaFZud+R6aY0jplOsFSe De2Q== X-Gm-Message-State: AMCzsaWP14qvvvLD1Ii+4KbiudzlT4ejxF122UNTNu6AoADIF49gPzvI VW+cz82bBQ8CRB/3jyHdYCU= X-Google-Smtp-Source: AOwi7QBjOYK/uVpHQiYfr7tP2uj/prOVmA/y7HokTGREtw6cpoFNvllYInVmFhS0wpIxlOmpsiANLw== X-Received: by 10.28.63.68 with SMTP id m65mr3937272wma.55.1506949260911; Mon, 02 Oct 2017 06:01:00 -0700 (PDT) From: Pradeep Jagadeesh X-Google-Original-From: Pradeep Jagadeesh To: "Manos Pitsidianakis" , "alberto garcia" , "eric blake" , "greg kurz" Date: Mon, 2 Oct 2017 09:00:28 -0400 Message-Id: <1506949228-48987-1-git-send-email-pradeep.jagadeesh@huawei.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH v0] block: replace throttle config strings with macros X-BeenThere: qemu-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org, jani kokkonen , Pradeep Jagadeesh , "Dr. David Alan Gilbert" , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@gnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch set uses the throttle macros to replace throttle=20 config strings. Signed-off-by: Pradeep Jagadeesh Reviewed-by: Alberto Garcia --- blockdev.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/blockdev.c b/blockdev.c index 56a6b24..153bc42 100644 --- a/blockdev.c +++ b/blockdev.c @@ -383,7 +383,8 @@ static void extract_common_blockdev_options(QemuOpts *o= pts, int *bdrv_flags, =20 /* disk I/O throttling */ if (throttling_group) { - *throttling_group =3D qemu_opt_get(opts, "throttling.group"); + *throttling_group =3D qemu_opt_get(opts, THROTTLE_OPT_PREFIX + QEMU_OPT_THROTTLE_GROUP_NAME); } =20 if (throttle_cfg) { @@ -802,25 +803,25 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfa= ceType block_default_type) const char *from; const char *to; } opt_renames[] =3D { - { "iops", "throttling.iops-total" }, - { "iops_rd", "throttling.iops-read" }, - { "iops_wr", "throttling.iops-write" }, + { "iops", THROTTLE_OPT_PREFIX QEMU_OPT_IOPS_TOTAL }, + { "iops_rd", THROTTLE_OPT_PREFIX QEMU_OPT_IOPS_READ }, + { "iops_wr", THROTTLE_OPT_PREFIX QEMU_OPT_IOPS_WRITE }, =20 - { "bps", "throttling.bps-total" }, - { "bps_rd", "throttling.bps-read" }, - { "bps_wr", "throttling.bps-write" }, + { "bps", THROTTLE_OPT_PREFIX QEMU_OPT_BPS_TOTAL }, + { "bps_rd", THROTTLE_OPT_PREFIX QEMU_OPT_BPS_READ }, + { "bps_wr", THROTTLE_OPT_PREFIX QEMU_OPT_BPS_WRITE }, =20 - { "iops_max", "throttling.iops-total-max" }, - { "iops_rd_max", "throttling.iops-read-max" }, - { "iops_wr_max", "throttling.iops-write-max" }, + { "iops_max", THROTTLE_OPT_PREFIX QEMU_OPT_IOPS_TOTAL_MAX }, + { "iops_rd_max", THROTTLE_OPT_PREFIX QEMU_OPT_IOPS_READ_MAX }, + { "iops_wr_max", THROTTLE_OPT_PREFIX QEMU_OPT_IOPS_WRITE_MAX }, =20 - { "bps_max", "throttling.bps-total-max" }, - { "bps_rd_max", "throttling.bps-read-max" }, - { "bps_wr_max", "throttling.bps-write-max" }, + { "bps_max", THROTTLE_OPT_PREFIX QEMU_OPT_BPS_TOTAL_MAX }, + { "bps_rd_max", THROTTLE_OPT_PREFIX QEMU_OPT_BPS_READ_MAX }, + { "bps_wr_max", THROTTLE_OPT_PREFIX QEMU_OPT_BPS_WRITE_MAX }, =20 - { "iops_size", "throttling.iops-size" }, + { "iops_size", THROTTLE_OPT_PREFIX QEMU_OPT_IOPS_SIZE }, =20 - { "group", "throttling.group" }, + { "group", THROTTLE_OPT_PREFIX QEMU_OPT_THROTTLE_GROUP_NA= ME }, =20 { "readonly", BDRV_OPT_READ_ONLY }, }; @@ -4089,7 +4090,7 @@ QemuOptsList qemu_common_drive_opts =3D { THROTTLE_OPTS, =20 { - .name =3D "throttling.group", + .name =3D THROTTLE_OPT_PREFIX QEMU_OPT_THROTTLE_GROUP_NAME, .type =3D QEMU_OPT_STRING, .help =3D "name of the block throttling group", },{ --=20 1.8.3.1