mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-03 02:26:37 +00:00
qemu: Do not try and generate invalid RTC parameters
If no RTC is specified in the config then do not generate any RTC command line options. RTC command line options are optional for QEMU so make Valid() return false when presented with the empty version of the RTC struct containing empty strings. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
8d626afb0c
commit
e46092e03a
12
qemu/qemu.go
12
qemu/qemu.go
@ -1064,16 +1064,12 @@ type RTC struct {
|
|||||||
|
|
||||||
// Valid returns true if the RTC structure is valid and complete.
|
// Valid returns true if the RTC structure is valid and complete.
|
||||||
func (rtc RTC) Valid() bool {
|
func (rtc RTC) Valid() bool {
|
||||||
if rtc.Clock != "" {
|
if rtc.Clock != Host && rtc.Clock != VM {
|
||||||
if rtc.Clock != Host && rtc.Clock != VM {
|
return false
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if rtc.DriftFix != "" {
|
if rtc.DriftFix != Slew && rtc.DriftFix != NoDriftFix {
|
||||||
if rtc.DriftFix != Slew && rtc.DriftFix != NoDriftFix {
|
return false
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user