summaryrefslogtreecommitdiffstats
path: root/monitor
diff options
context:
space:
mode:
authorPaolo Bonzini2022-07-14 14:08:09 +0200
committerPaolo Bonzini2022-07-18 18:51:17 +0200
commit1ca1a7ec3637bc19818eab8085cbbe273217ad68 (patch)
tree7f75de33538fb46f235fecf7064da29b30bef5a8 /monitor
parentMerge tag 'nvme-next-pull-request' of git://git.infradead.org/qemu-nvme into ... (diff)
downloadqemu-1ca1a7ec3637bc19818eab8085cbbe273217ad68.tar.gz
qemu-1ca1a7ec3637bc19818eab8085cbbe273217ad68.tar.xz
qemu-1ca1a7ec3637bc19818eab8085cbbe273217ad68.zip
monitor: add support for boolean statistics
The next version of Linux will introduce boolean statistics, which can only have 0 or 1 values. Support them in the schema and in the HMP command. Suggested-by: Amneesh Singh <natto@weirdnatto.in> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'monitor')
-rw-r--r--monitor/hmp-cmds.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index ca98df0495..e8d6963722 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -2337,6 +2337,8 @@ static void print_stats_results(Monitor *mon, StatsTarget target,
if (stats_value->type == QTYPE_QNUM) {
monitor_printf(mon, ": %" PRId64 "\n", stats_value->u.scalar);
+ } else if (stats_value->type == QTYPE_QBOOL) {
+ monitor_printf(mon, ": %s\n", stats_value->u.boolean ? "yes" : "no");
} else if (stats_value->type == QTYPE_QLIST) {
uint64List *list;
int i;