[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/14] block: tidy ThrottleGroupMember initialization
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 10/14] block: tidy ThrottleGroupMember initializations |
Date: |
Wed, 6 Sep 2017 16:02:42 +0200 |
From: Manos Pitsidianakis <address@hidden>
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.
Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Manos Pitsidianakis <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
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 b4acd0f2ae..45d9101be3 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -273,9 +273,6 @@ BlockBackend *blk_new(uint64_t perm, uint64_t shared_perm)
blk->shared_perm = shared_perm;
blk_set_enable_write_cache(blk, true);
- qemu_co_mutex_init(&blk->public.throttle_group_member.throttled_reqs_lock);
- 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);
notifier_list_init(&blk->remove_bs_notifiers);
diff --git a/block/throttle-groups.c b/block/throttle-groups.c
index 3b07b25f39..7749cf043f 100644
--- a/block/throttle-groups.c
+++ b/block/throttle-groups.c
@@ -508,6 +508,9 @@ void throttle_group_register_tgm(ThrottleGroupMember *tgm,
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]);
qemu_mutex_unlock(&tg->lock);
}
--
2.13.5
- [Qemu-devel] [PULL 00/14] Block layer patches, Kevin Wolf, 2017/09/06
- [Qemu-devel] [PULL 02/14] block: remove unused bdrv_media_changed, Kevin Wolf, 2017/09/06
- [Qemu-devel] [PULL 05/14] qcow: Change signature of get_cluster_offset(), Kevin Wolf, 2017/09/06
- [Qemu-devel] [PULL 03/14] block: remove bdrv_truncate callback in blkdebug, Kevin Wolf, 2017/09/06
- [Qemu-devel] [PULL 06/14] qcow: Check failure of bdrv_getlength() and bdrv_truncate(), Kevin Wolf, 2017/09/06
- [Qemu-devel] [PULL 01/14] block: pass bdrv_* methods to bs->file by default in block filters, Kevin Wolf, 2017/09/06
- [Qemu-devel] [PULL 10/14] block: tidy ThrottleGroupMember initializations,
Kevin Wolf <=
- [Qemu-devel] [PULL 04/14] block: add default implementations for bdrv_co_get_block_status(), Kevin Wolf, 2017/09/06
- [Qemu-devel] [PULL 07/14] block: document semantics of bdrv_co_preadv|pwritev, Kevin Wolf, 2017/09/06
- [Qemu-devel] [PULL 12/14] block: add throttle block filter driver, Kevin Wolf, 2017/09/06
- [Qemu-devel] [PULL 11/14] block: convert ThrottleGroup to object with QOM, Kevin Wolf, 2017/09/06
- [Qemu-devel] [PULL 08/14] block: move ThrottleGroup membership to ThrottleGroupMember, Kevin Wolf, 2017/09/06
- [Qemu-devel] [PULL 09/14] block: add aio_context field in ThrottleGroupMember, Kevin Wolf, 2017/09/06
- [Qemu-devel] [PULL 13/14] qemu-iotests: add 184 for throttle filter driver, Kevin Wolf, 2017/09/06
- [Qemu-devel] [PULL 14/14] qcow2: move qcow2_store_persistent_dirty_bitmaps() before cache flushing, Kevin Wolf, 2017/09/06
- Re: [Qemu-devel] [PULL 00/14] Block layer patches, Peter Maydell, 2017/09/07