mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-28 03:23:25 +08:00
fix(host): host add option no_hpet
Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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 ""
|
||||
}
|
||||
|
||||
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user