From a8aa6a51076d34b88a7f1e3826ed401792010fdc Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 30 Nov 2021 16:07:53 +0100 Subject: [PATCH] qemuMonitorJSONHandleShutdown: Use virTristateBoolFromBool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of a ternary operator we can use the existing helper. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/qemu/qemu_monitor_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index a72d7c2099..b45aae9d96 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -574,7 +574,7 @@ static void qemuMonitorJSONHandleShutdown(qemuMonitor *mon, virJSONValue *data) virTristateBool guest_initiated = VIR_TRISTATE_BOOL_ABSENT; if (data && virJSONValueObjectGetBoolean(data, "guest", &guest) == 0) - guest_initiated = guest ? VIR_TRISTATE_BOOL_YES : VIR_TRISTATE_BOOL_NO; + guest_initiated = virTristateBoolFromBool(guest); qemuMonitorEmitShutdown(mon, guest_initiated); }