Skip to content
Snippets Groups Projects
Commit f738cfc8 authored by Manos Pitsidianakis's avatar Manos Pitsidianakis Committed by Kevin Wolf
Browse files

block: tidy ThrottleGroupMember initializations


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: default avatarAlberto Garcia <berto@igalia.com>
Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: default avatarManos Pitsidianakis <el13635@mail.ntua.gr>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent c61791fc
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment