Merge pull request #16471 from wanyaoqi/fix/live-migrate-cpu-mem-update

fix(host): update cpudesc on cpu hotpluged
This commit is contained in:
Zexi Li
2023-04-14 19:34:11 +08:00
committed by GitHub
2 changed files with 3 additions and 3 deletions
+1
View File
@@ -2398,6 +2398,7 @@ func (task *SGuestHotplugCpuMemTask) onAddMemDevice(reason string) {
func (task *SGuestHotplugCpuMemTask) updateGuestDesc() {
task.Desc.Cpu += int64(task.addedCpuCount)
task.Desc.CpuDesc.Cpus += uint(task.addedCpuCount)
task.Desc.Mem += int64(task.addedMemSize)
if task.addedMemSize > 0 {
if task.Desc.MemDesc.MemSlots == nil {
+2 -3
View File
@@ -2062,9 +2062,8 @@ func (s *SKVMGuestInstance) SyncConfig(
return nil, nil
}
// update guest live desc
s.Desc.Cpu = guestDesc.Cpu
s.Desc.Mem = guestDesc.Mem
// update guest live desc, don't be here update cpu and mem
// cpu and memory should update from SGuestHotplugCpuMemTask
s.Desc.SGuestControlDesc = guestDesc.SGuestControlDesc
s.Desc.SGuestProjectDesc = guestDesc.SGuestProjectDesc
s.Desc.SGuestRegionDesc = guestDesc.SGuestRegionDesc