qemuMonitorJSONHandleShutdown: Use virTristateBoolFromBool

Instead of a ternary operator we can use the existing helper.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2021-11-30 16:07:53 +01:00
parent 6fbf8873c0
commit a8aa6a5107

View File

@ -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);
}