fix(host): fix machine type before generate cpu desc

Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
This commit is contained in:
wanyaoqi
2023-04-20 09:25:58 +08:00
parent 2466bf277e
commit 236da99fa7
+1 -1
View File
@@ -789,13 +789,13 @@ func (s *SKVMGuestInstance) gpusHasVga() bool {
func (s *SKVMGuestInstance) initCpuDesc(cpuMax uint) error {
var err error
s.fixGuestMachineType()
if cpuMax == 0 {
cpuMax, err = s.CpuMax()
if err != nil {
return err
}
}
s.fixGuestMachineType()
cpuDesc, err := s.archMan.GenerateCpuDesc(uint(s.Desc.Cpu), cpuMax, s)
if err != nil {
return err