Merge pull request #11970 from zexi/allow-bw-zero

fix(region): allow guest network zero bandwidth limit
This commit is contained in:
yunion-ci-robot
2021-08-23 12:14:12 +08:00
committed by GitHub
2 changed files with 4 additions and 2 deletions
+3
View File
@@ -794,6 +794,9 @@ func (self *SGuestnetwork) IsExit() bool {
}
func (self *SGuestnetwork) getBandwidth() int {
if self.BwLimit == 0 {
return 0
}
if self.BwLimit > 0 && self.BwLimit <= api.MAX_BANDWIDTH {
return self.BwLimit
} else {
+1 -2
View File
@@ -49,8 +49,7 @@ type SHostOptions struct {
EnableMonitor bool `help:"Enable monitor"`
ReportInterval int `help:"Report interval in seconds" default:"60"`
EnableTcBwlimit bool `help:"Enable linux tc bandwidth limit"`
BwDownloadBandwidth int `help:"Default ingress bandwidth in mbit (0 disabled)" default:"10"`
BwDownloadBandwidth int `help:"Default ingress bandwidth in mbit (0 disabled)" default:"10"`
DnsServer string `help:"Address of host DNS server"`
DnsServerLegacy string `help:"Deprecated Address of host DNS server"`