Skip to content

Commit

Permalink
fix: 避免在仅调整虚拟机磁盘时opslog日志记录mem cpu异常 (#7393)
Browse files Browse the repository at this point in the history
Co-authored-by: Qu Xuan <quxuan@yunionyun.com>
  • Loading branch information
ioito and Qu Xuan committed Jul 31, 2020
1 parent a2d562c commit 5dc8296
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/compute/tasks/guest_change_config_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ func (self *GuestChangeConfigTask) OnGuestChangeCpuMemSpecComplete(ctx context.C
return
}
changeConfigSpec := jsonutils.NewDict()
if addCpu != 0 {
if vcpuCount > 0 && addCpu != 0 {
changeConfigSpec.Set("add_cpu", jsonutils.NewInt(int64(addCpu)))
}
if addMem != 0 {
if vmemSize > 0 && addMem != 0 {
changeConfigSpec.Set("add_mem", jsonutils.NewInt(int64(addMem)))
}
if len(instanceType) > 0 {
Expand Down

0 comments on commit 5dc8296

Please sign in to comment.