From: Peter Krempa Date: Tue, 30 Nov 2021 15:07:53 +0000 (+0100) Subject: qemuMonitorJSONHandleShutdown: Use virTristateBoolFromBool X-Git-Tag: v8.0.0-rc1~354 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8aa6a51076d34b88a7f1e3826ed401792010fdc;p=thirdparty%2Flibvirt.git qemuMonitorJSONHandleShutdown: Use virTristateBoolFromBool Instead of a ternary operator we can use the existing helper. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- 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); }