From 1ca1a7ec3637bc19818eab8085cbbe273217ad68 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 14 Jul 2022 14:08:09 +0200 Subject: 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 Signed-off-by: Paolo Bonzini --- monitor/hmp-cmds.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'monitor') diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index ca98df0..e8d6963 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; -- cgit v1.1