summaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorChandan Somani <csomani@redhat.com>2025-10-03 14:59:26 -0700
committerKevin Wolf <kwolf@redhat.com>2025-10-29 12:10:09 +0100
commit9f0c763e16c65d3aab5f3f17768df58321874685 (patch)
tree27e70a994523a2ef3682b7edf52de3adb2771628 /blockdev.c
parent3ab02c857047c16e622a7ad2adb51ef21e24989e (diff)
downloadqemu-9f0c763e16c65d3aab5f3f17768df58321874685.tar.gz
qemu-9f0c763e16c65d3aab5f3f17768df58321874685.zip
block: enable stats-intervals for storage devices
This patch allows stats-intervals to be used for storage devices with the -device option. It accepts a list of interval lengths in JSON format. It configures and collects the stats in the BlockBackend layer through the storage device that consumes the BlockBackend. Signed-off-by: Chandan Somani <csomani@redhat.com> Message-ID: <20251003220039.1336663-1-csomani@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/blockdev.c b/blockdev.c
index b451fee6e1..dbd1d4d3e8 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -617,7 +617,8 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
bs->detect_zeroes = detect_zeroes;
- block_acct_setup(blk_get_stats(blk), account_invalid, account_failed);
+ block_acct_setup(blk_get_stats(blk), account_invalid, account_failed,
+ NULL, 0, NULL);
if (!parse_stats_intervals(blk_get_stats(blk), interval_list, errp)) {
blk_unref(blk);