Blame SOURCES/kvm-block-tidy-ThrottleGroupMember-initializations.patch

4a2fec
From 339d01accebcd27e23600e709ef426cdb794cf2e Mon Sep 17 00:00:00 2001
4a2fec
From: Stefan Hajnoczi <stefanha@redhat.com>
4a2fec
Date: Fri, 17 Nov 2017 11:19:02 +0100
4a2fec
Subject: [PATCH 03/15] block: tidy ThrottleGroupMember initializations
4a2fec
4a2fec
RH-Author: Stefan Hajnoczi <stefanha@redhat.com>
4a2fec
Message-id: <20171117111908.8815-4-stefanha@redhat.com>
4a2fec
Patchwork-id: 77739
4a2fec
O-Subject: [RHV7.5 qemu-kvm-rhev PATCH 3/9] block: tidy ThrottleGroupMember initializations
4a2fec
Bugzilla: 1492295
4a2fec
RH-Acked-by: John Snow <jsnow@redhat.com>
4a2fec
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
4a2fec
RH-Acked-by: Thomas Huth <thuth@redhat.com>
4a2fec
4a2fec
From: Manos Pitsidianakis <el13635@mail.ntua.gr>
4a2fec
4a2fec
Move the CoMutex and CoQueue inits inside throttle_group_register_tgm()
4a2fec
which is called whenever a ThrottleGroupMember is initialized. There's
4a2fec
no need for them to be separate.
4a2fec
4a2fec
Reviewed-by: Alberto Garcia <berto@igalia.com>
4a2fec
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
4a2fec
Signed-off-by: Manos Pitsidianakis <el13635@mail.ntua.gr>
4a2fec
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
4a2fec
(cherry picked from commit f738cfc843055238ad969782db69156929873832)
4a2fec
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
---
4a2fec
 block/block-backend.c   | 3 ---
4a2fec
 block/throttle-groups.c | 3 +++
4a2fec
 2 files changed, 3 insertions(+), 3 deletions(-)
4a2fec
4a2fec
diff --git a/block/block-backend.c b/block/block-backend.c
4a2fec
index 515be10..6826476 100644
4a2fec
--- a/block/block-backend.c
4a2fec
+++ b/block/block-backend.c
4a2fec
@@ -273,9 +273,6 @@ BlockBackend *blk_new(uint64_t perm, uint64_t shared_perm)
4a2fec
     blk->shared_perm = shared_perm;
4a2fec
     blk_set_enable_write_cache(blk, true);
4a2fec
 
4a2fec
-    qemu_co_mutex_init(&blk->public.throttle_group_member.throttled_reqs_lock);
4a2fec
-    qemu_co_queue_init(&blk->public.throttle_group_member.throttled_reqs[0]);
4a2fec
-    qemu_co_queue_init(&blk->public.throttle_group_member.throttled_reqs[1]);
4a2fec
     block_acct_init(&blk->stats);
4a2fec
 
4a2fec
     notifier_list_init(&blk->remove_bs_notifiers);
4a2fec
diff --git a/block/throttle-groups.c b/block/throttle-groups.c
4a2fec
index 3b07b25..7749cf0 100644
4a2fec
--- a/block/throttle-groups.c
4a2fec
+++ b/block/throttle-groups.c
4a2fec
@@ -508,6 +508,9 @@ void throttle_group_register_tgm(ThrottleGroupMember *tgm,
4a2fec
                          read_timer_cb,
4a2fec
                          write_timer_cb,
4a2fec
                          tgm);
4a2fec
+    qemu_co_mutex_init(&tgm->throttled_reqs_lock);
4a2fec
+    qemu_co_queue_init(&tgm->throttled_reqs[0]);
4a2fec
+    qemu_co_queue_init(&tgm->throttled_reqs[1]);
4a2fec
 
4a2fec
     qemu_mutex_unlock(&tg->lock);
4a2fec
 }
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec