summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorBenoît Canet <benoit.canet@nodalink.com>2014-09-05 15:46:15 +0200
committerKevin Wolf <kwolf@redhat.com>2014-09-10 10:41:29 +0200
commit0ddd0ad96abf55acad06324b26b69a24bde23ac5 (patch)
treee1f834a9b89fb4802bc08a24b70e1e3a7c19332c /block.c
parent1a7044bb62ca490b8742ac17d40bb774b7a9048e (diff)
downloadqemu-0ddd0ad96abf55acad06324b26b69a24bde23ac5.tar.gz
block: Extract the BlockAcctStats structure
Extract the block accounting statistics into a structure so the block device models can hold them in the future. CC: Kevin Wolf <kwolf@redhat.com> CC: Stefan Hajnoczi <stefanha@redhat.com> CC: Max Reitz <mreitz@redhat.com> CC: Eric Blake <eblake@redhat.com> Signed-off-by: Benoît Canet <benoit.canet@nodalink.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/block.c b/block.c
index 460effe4fb..e90f431154 100644
--- a/block.c
+++ b/block.c
@@ -3363,8 +3363,8 @@ static int coroutine_fn bdrv_aligned_pwritev(BlockDriverState *bs,
bdrv_set_dirty(bs, sector_num, nb_sectors);
- if (bs->wr_highest_sector < sector_num + nb_sectors - 1) {
- bs->wr_highest_sector = sector_num + nb_sectors - 1;
+ if (bs->stats.wr_highest_sector < sector_num + nb_sectors - 1) {
+ bs->stats.wr_highest_sector = sector_num + nb_sectors - 1;
}
if (bs->growable && ret >= 0) {
bs->total_sectors = MAX(bs->total_sectors, sector_num + nb_sectors);
@@ -5588,9 +5588,10 @@ bdrv_acct_done(BlockDriverState *bs, BlockAcctCookie *cookie)
{
assert(cookie->type < BDRV_MAX_IOTYPE);
- bs->nr_bytes[cookie->type] += cookie->bytes;
- bs->nr_ops[cookie->type]++;
- bs->total_time_ns[cookie->type] += get_clock() - cookie->start_time_ns;
+ bs->stats.nr_bytes[cookie->type] += cookie->bytes;
+ bs->stats.nr_ops[cookie->type]++;
+ bs->stats.total_time_ns[cookie->type] += get_clock() -
+ cookie->start_time_ns;
}
void bdrv_img_create(const char *filename, const char *fmt,