diff options
Diffstat (limited to 'block/qapi.c')
-rw-r--r-- | block/qapi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/block/qapi.c b/block/qapi.c index 89d4274177..9799656761 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -357,6 +357,11 @@ static BlockStats *bdrv_query_stats(const BlockDriverState *bs, s->stats->wr_total_time_ns = stats->total_time_ns[BLOCK_ACCT_WRITE]; s->stats->rd_total_time_ns = stats->total_time_ns[BLOCK_ACCT_READ]; s->stats->flush_total_time_ns = stats->total_time_ns[BLOCK_ACCT_FLUSH]; + + s->stats->has_idle_time_ns = stats->last_access_time_ns > 0; + if (s->stats->has_idle_time_ns) { + s->stats->idle_time_ns = block_acct_idle_time_ns(stats); + } } s->stats->wr_highest_offset = bs->wr_highest_offset; |