@@ -577,8 +577,8 @@ void hmp_info_blockstats(Monitor *mon, const QDict *qdict)
}
monitor_printf(mon, "%s:", stats->value->device);
- monitor_printf(mon, " rd_bytes=%" PRId64
- " wr_bytes=%" PRId64
+ monitor_printf(mon, " rd_bytes=%" PRIu64
+ " wr_bytes=%" PRIu64
" rd_operations=%" PRId64
" wr_operations=%" PRId64
" flush_operations=%" PRId64
@@ -704,10 +704,10 @@
# Since: 0.14.0
##
{ 'struct': 'BlockDeviceStats',
- 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
+ 'data': {'rd_bytes': 'size', 'wr_bytes': 'size', 'rd_operations': 'int',
'wr_operations': 'int', 'flush_operations': 'int',
'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
- 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
+ 'rd_total_time_ns': 'int', 'wr_highest_offset': 'size',
'rd_merged': 'int', 'wr_merged': 'int', '*idle_time_ns': 'int',
'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
'failed_flush_operations': 'int', 'invalid_rd_operations': 'int',
Byte counts and file offsets should use QAPI type 'size' (uint64_t). BlockDeviceStats members @rd_bytes, @wr_bytes and @wr_highest_offset are 'int' (int64_t). bdrv_query_blk_stats() gets them from BlockAcctStats member nr_bytes[] and stat64_get(), implicitly converting from uint64_t. Change all three to 'size'. query-blockstats now report byte counts and file offsets above 2^63-1 correctly instead of their (negative) two's complement. So does HMP's "info blockstats". Signed-off-by: Markus Armbruster <armbru@redhat.com> --- hmp.c | 4 ++-- qapi/block-core.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)