mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
fix(host): live migrate misc fix
This commit is contained in:
@@ -1053,7 +1053,7 @@ func (s *SGuestLiveMigrateTask) onSetAutoConverge(res string) {
|
||||
s.Monitor.MigrateSetCapability("events", "on", s.onMigrateEnableEvents)
|
||||
}
|
||||
|
||||
func (s SGuestLiveMigrateTask) onMigrateEnableEvents(res string) {
|
||||
func (s *SGuestLiveMigrateTask) onMigrateEnableEvents(res string) {
|
||||
if strings.Contains(strings.ToLower(res), "error") {
|
||||
s.migrateFailed(fmt.Sprintf("Migrate set capability events error: %s", res))
|
||||
return
|
||||
|
||||
@@ -169,10 +169,16 @@ func generateMachineOption(machine string, machineDesc *desc.SGuestMachine) stri
|
||||
}
|
||||
|
||||
func generateSMPOption(cpu *desc.SGuestCpu) string {
|
||||
return fmt.Sprintf(
|
||||
"-smp cpus=%d,sockets=%d,cores=%d,maxcpus=%d",
|
||||
cpu.Cpus, cpu.Sockets, cpu.Cores, cpu.MaxCpus,
|
||||
)
|
||||
if cpu.MaxCpus%2 > 0 {
|
||||
return fmt.Sprintf(
|
||||
"-smp cpus=%d,maxcpus=%d", cpu.Cpus, cpu.MaxCpus,
|
||||
)
|
||||
} else {
|
||||
return fmt.Sprintf(
|
||||
"-smp cpus=%d,sockets=%d,cores=%d,maxcpus=%d",
|
||||
cpu.Cpus, cpu.Sockets, cpu.Cores, cpu.MaxCpus,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
func generateCPUOption(cpu *desc.SGuestCpu) string {
|
||||
|
||||
Reference in New Issue
Block a user