mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
6fbf8873c0
commit
a8aa6a5107
|
@ -574,7 +574,7 @@ static void qemuMonitorJSONHandleShutdown(qemuMonitor *mon, virJSONValue *data)
|
||||||
virTristateBool guest_initiated = VIR_TRISTATE_BOOL_ABSENT;
|
virTristateBool guest_initiated = VIR_TRISTATE_BOOL_ABSENT;
|
||||||
|
|
||||||
if (data && virJSONValueObjectGetBoolean(data, "guest", &guest) == 0)
|
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);
|
qemuMonitorEmitShutdown(mon, guest_initiated);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue