diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2017-06-05 14:39:07 +0200 |
---|---|---|
committer | Fam Zheng <famz@redhat.com> | 2017-06-16 07:55:00 +0800 |
commit | 9caa6f3dbe20f2c506df6698386fce941fc6238a (patch) | |
tree | 0d2cceb60dbfe4f1d01cef4c23f69edbabcd7dac /block/block-backend.c | |
parent | 39c1b4254e6200519d747f6cb8c888004e2446e2 (diff) | |
download | qemu-9caa6f3dbe20f2c506df6698386fce941fc6238a.zip qemu-9caa6f3dbe20f2c506df6698386fce941fc6238a.tar.gz qemu-9caa6f3dbe20f2c506df6698386fce941fc6238a.tar.bz2 |
block: split BlockAcctStats creation and setup
block_acct_destroy is called unconditionally in blk_delete, but there is
no BlockAcctStats function that is called unconditionally in blk_new.
Split block_acct_init in two, so that it will be possible to create a
QemuMutex in block_acct_init and destroy it in block_acct_cleanup.
Cc: Alberto Garcia <berto@igalia.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20170605123908.18777-19-pbonzini@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Diffstat (limited to 'block/block-backend.c')
-rw-r--r-- | block/block-backend.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/block/block-backend.c b/block/block-backend.c index 738882d..a2bbae9 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -219,6 +219,7 @@ BlockBackend *blk_new(uint64_t perm, uint64_t shared_perm) qemu_co_mutex_init(&blk->public.throttled_reqs_lock); qemu_co_queue_init(&blk->public.throttled_reqs[0]); qemu_co_queue_init(&blk->public.throttled_reqs[1]); + block_acct_init(&blk->stats); notifier_list_init(&blk->remove_bs_notifiers); notifier_list_init(&blk->insert_bs_notifiers); |