diff options
author | Paolo Bonzini | 2017-06-05 14:39:07 +0200 |
---|---|---|
committer | Fam Zheng | 2017-06-16 01:55:00 +0200 |
commit | 9caa6f3dbe20f2c506df6698386fce941fc6238a (patch) | |
tree | 0d2cceb60dbfe4f1d01cef4c23f69edbabcd7dac /include/block/accounting.h | |
parent | block: introduce block_account_one_io (diff) | |
download | qemu-9caa6f3dbe20f2c506df6698386fce941fc6238a.tar.gz qemu-9caa6f3dbe20f2c506df6698386fce941fc6238a.tar.xz qemu-9caa6f3dbe20f2c506df6698386fce941fc6238a.zip |
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 'include/block/accounting.h')
-rw-r--r-- | include/block/accounting.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/block/accounting.h b/include/block/accounting.h index 20891639d5..55cb06fdb6 100644 --- a/include/block/accounting.h +++ b/include/block/accounting.h @@ -61,7 +61,8 @@ typedef struct BlockAcctCookie { enum BlockAcctType type; } BlockAcctCookie; -void block_acct_init(BlockAcctStats *stats, bool account_invalid, +void block_acct_init(BlockAcctStats *stats); +void block_acct_setup(BlockAcctStats *stats, bool account_invalid, bool account_failed); void block_acct_cleanup(BlockAcctStats *stats); void block_acct_add_interval(BlockAcctStats *stats, unsigned interval_length); |