From 9caa6f3dbe20f2c506df6698386fce941fc6238a Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 5 Jun 2017 14:39:07 +0200 Subject: 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 Signed-off-by: Paolo Bonzini Message-Id: <20170605123908.18777-19-pbonzini@redhat.com> Reviewed-by: Alberto Garcia Signed-off-by: Fam Zheng --- blockdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'blockdev.c') diff --git a/blockdev.c b/blockdev.c index 39f289b..39d6b97 100644 --- a/blockdev.c +++ b/blockdev.c @@ -595,7 +595,7 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts, autostart = 0; } - block_acct_init(blk_get_stats(blk), account_invalid, account_failed); + block_acct_setup(blk_get_stats(blk), account_invalid, account_failed); if (!parse_stats_intervals(blk_get_stats(blk), interval_list, errp)) { blk_unref(blk); -- cgit v1.1