From 29529a5d72ea7394202e272d9b2a48fe6b978d8e Mon Sep 17 00:00:00 2001 From: Shuicheng Lin Date: Mon, 4 May 2020 22:56:21 +0800 Subject: [PATCH] Add rt clock definition for rtc clock in qemu There are three different types for the RTC clock: host, rt and vm. Add `rt` to the list of RTC clocks. Signed-off-by: Shuicheng Lin --- qemu/qemu.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qemu/qemu.go b/qemu/qemu.go index ed211d3ccb..3012ceb375 100644 --- a/qemu/qemu.go +++ b/qemu/qemu.go @@ -1876,6 +1876,9 @@ const ( // Host is for using the host clock as a reference. Host RTCClock = "host" + // RT is for using the host monotonic clock as a reference. + RT RTCClock = "rt" + // VM is for using the guest clock as a reference VM RTCClock = "vm" ) @@ -1902,7 +1905,7 @@ type RTC struct { // Valid returns true if the RTC structure is valid and complete. func (rtc RTC) Valid() bool { - if rtc.Clock != Host && rtc.Clock != VM { + if rtc.Clock != Host && rtc.Clock != RT && rtc.Clock != VM { return false }