fix(host): set migrate bandwidth nolimit (#17974)

This commit is contained in:
wanyaoqi
2023-09-10 00:26:32 +08:00
committed by GitHub
parent f1ffdc287d
commit 07c4d4da0f
+4 -2
View File
@@ -17,6 +17,7 @@ package guestman
import (
"context"
"fmt"
"math"
"os"
"path"
"regexp"
@@ -1203,8 +1204,9 @@ func (s *SGuestLiveMigrateTask) setMaxBandwidth(res string) {
return
}
var maxBandwidth int64 = 0
if s.params.MaxBandwidthMB != nil {
// default set bandwidth no limit
var maxBandwidth int64 = math.MaxInt64
if s.params.MaxBandwidthMB != nil && *s.params.MaxBandwidthMB > 0 {
maxBandwidth = *s.params.MaxBandwidthMB * 1024 * 1024
}