block: split BlockAcctStats creation and setup
commit9caa6f3dbe20f2c506df6698386fce941fc6238a
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 5 Jun 2017 12:39:07 +0000 (5 14:39 +0200)
committerFam Zheng <famz@redhat.com>
Thu, 15 Jun 2017 23:55:00 +0000 (16 07:55 +0800)
tree0d2cceb60dbfe4f1d01cef4c23f69edbabcd7dac
parent39c1b4254e6200519d747f6cb8c888004e2446e2
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>
block/accounting.c
block/block-backend.c
blockdev.c
include/block/accounting.h