From nobody Tue Feb 10 03:38:21 2026 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@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500025689957740.7189706490783; Fri, 14 Jul 2017 02:48:09 -0700 (PDT) Received: from localhost ([::1]:36570 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVxCi-0004AV-Tv for importer@patchew.org; Fri, 14 Jul 2017 05:48:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVxAw-00030o-JX for qemu-devel@nongnu.org; Fri, 14 Jul 2017 05:46:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVxAv-0002qg-Cn for qemu-devel@nongnu.org; Fri, 14 Jul 2017 05:46:18 -0400 Received: from smtp1.ntua.gr ([2001:648:2000:de::183]:55300) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVxAq-0002pD-RL; Fri, 14 Jul 2017 05:46:13 -0400 Received: from mail.ntua.gr (ppp046176127036.access.hol.gr [46.176.127.36]) (authenticated bits=0) by smtp1.ntua.gr (8.15.2/8.15.2) with ESMTPSA id v6E9jfK6076301 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Jul 2017 12:45:41 +0300 (EEST) (envelope-from el13635@mail.ntua.gr) X-Authentication-Warning: smtp1.ntua.gr: Host ppp046176127036.access.hol.gr [46.176.127.36] claimed to be mail.ntua.gr From: Manos Pitsidianakis To: qemu-devel Date: Fri, 14 Jul 2017 12:45:17 +0300 Message-Id: <20170714094521.4909-4-el13635@mail.ntua.gr> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170714094521.4909-1-el13635@mail.ntua.gr> References: <20170714094521.4909-1-el13635@mail.ntua.gr> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:648:2000:de::183 Subject: [Qemu-devel] [PATCH 3/7] block: tidy ThrottleGroupMember initializations 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 , Alberto Garcia , qemu-block , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Move the CoMutex and CoQueue inits inside throttle_group_register_tgm() which is called whenever a ThrottleGroupMember is initialized. There's no need for them to be separate. Signed-off-by: Manos Pitsidianakis Reviewed-by: Stefan Hajnoczi --- block/block-backend.c | 3 --- block/throttle-groups.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index 37b95dd20a..1c7f46fbaf 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -216,9 +216,6 @@ BlockBackend *blk_new(uint64_t perm, uint64_t shared_pe= rm) blk->shared_perm =3D shared_perm; blk_set_enable_write_cache(blk, true); =20 - qemu_co_mutex_init(&blk->public.throttle_group_member.throttled_reqs_l= ock); - qemu_co_queue_init(&blk->public.throttle_group_member.throttled_reqs[0= ]); - qemu_co_queue_init(&blk->public.throttle_group_member.throttled_reqs[1= ]); block_acct_init(&blk->stats); =20 notifier_list_init(&blk->remove_bs_notifiers); diff --git a/block/throttle-groups.c b/block/throttle-groups.c index a979e86243..f711a3dc62 100644 --- a/block/throttle-groups.c +++ b/block/throttle-groups.c @@ -508,6 +508,9 @@ void throttle_group_register_tgm(ThrottleGroupMember *t= gm, read_timer_cb, write_timer_cb, tgm); + qemu_co_mutex_init(&tgm->throttled_reqs_lock); + qemu_co_queue_init(&tgm->throttled_reqs[0]); + qemu_co_queue_init(&tgm->throttled_reqs[1]); =20 qemu_mutex_unlock(&tg->lock); } --=20 2.11.0