fix(host): host add option no_hpet

Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
This commit is contained in:
wanyaoqi
2023-06-12 17:22:46 +08:00
parent fcf8b77d6a
commit de8d4e588c
5 changed files with 19 additions and 0 deletions
+1
View File
@@ -84,6 +84,7 @@ type SGuestHardwareDesc struct {
// supported machine type: pc, q35, virt
Machine string
MachineDesc *SGuestMachine `json:",omitempty"`
NoHpet *bool `json:",omitempty"` // i386 target only
VirtioSerial *SGuestVirtioSerial
+5
View File
@@ -921,6 +921,11 @@ func (s *SKVMGuestInstance) fixGuestMachineType() {
func (s *SKVMGuestInstance) initMachineDesc() {
s.Desc.MachineDesc = s.archMan.GenerateMachineDesc(s.Desc.CpuDesc.Accel)
if options.HostOptions.NoHpet {
noHpet := true
s.Desc.NoHpet = &noHpet
}
}
func (s *SKVMGuestInstance) initQgaDesc() {
+3
View File
@@ -647,6 +647,9 @@ func GenerateStartOptions(
opts = append(opts, getMonitorOptions(drvOpt, input.QMPMonitor)...)
}
if input.GuestDesc.NoHpet != nil && *input.GuestDesc.NoHpet {
opts = append(opts, drvOpt.NoHpet())
}
opts = append(opts,
drvOpt.RTC(),
// drvOpt.Daemonize(),
+9
View File
@@ -87,6 +87,7 @@ type QemuOptions interface {
Daemonize() string
Nodefaults() string
Nodefconfig() string
NoHpet() string
Global() string
KeyboardLayoutLanguage(lang string) string
Name(name string) string
@@ -205,6 +206,10 @@ func (o baseOptions) Nodefaults() string {
return "-nodefaults"
}
func (o baseOptions) NoHpet() string {
return "-no-hpet"
}
func (o baseOptions) Nodefconfig() string {
return "-nodefconfig"
}
@@ -354,3 +359,7 @@ func newBaseOptions_aarch64() *baseOptions_aarch64 {
func (o baseOptions_aarch64) Global() string {
return ""
}
func (o baseOptions_aarch64) NoHpet() string {
return ""
}
+1
View File
@@ -33,6 +33,7 @@ type SHostBaseOptions struct {
LiveMigrateCpuThrottleMax int64 `default:"99" help:"live migrate auto converge cpu throttle max"`
DefaultQemuVersion string `help:"Default qemu version" default:"4.2.0"`
NoHpet bool `help:"disable qemu hpet timer" default:"false"`
CdromCount int `help:"cdrom count" default:"1"`
FloppyCount int `help:"floppy count" default:"1"`