fix: remove default values from cmtbound columns (#22157)

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2025-02-24 17:32:06 +08:00
committed by GitHub
co-authored by Qiu Jian
parent 68aef7f31c
commit 4a2e1cc26d
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -137,7 +137,7 @@ type SHost struct {
// 预留CPU大小
CpuReserved int `nullable:"true" default:"0" list:"domain" update:"domain" create:"domain_optional"`
// CPU超分比
CpuCmtbound float32 `nullable:"true" default:"8" list:"domain" create:"domain_optional"`
CpuCmtbound float32 `nullable:"true" list:"domain" create:"domain_optional"`
// CPUMicrocode
CpuMicrocode string `width:"64" charset:"ascii" nullable:"true" get:"domain" update:"domain" create:"domain_optional"`
// CPU架构
@@ -148,7 +148,7 @@ type SHost struct {
// 预留内存大小
MemReserved int `nullable:"true" default:"0" list:"domain" update:"domain" create:"domain_optional"`
// 内存超分比
MemCmtbound float32 `nullable:"true" default:"1" list:"domain" create:"domain_optional"`
MemCmtbound float32 `nullable:"true" list:"domain" create:"domain_optional"`
// 页大小
PageSizeKB int `nullable:"false" default:"4" list:"domain" update:"domain" create:"domain_optional"`
EnableNumaAllocate bool `nullable:"true" default:"false" list:"domain" update:"domain" create:"domain_optional"`
+4 -4
View File
@@ -88,7 +88,7 @@ type SStorage struct {
// example: ssd
MediumType string `width:"32" charset:"ascii" nullable:"false" list:"user" update:"domain" create:"domain_required"`
// 超售比
Cmtbound float32 `nullable:"true" default:"1" list:"domain"`
Cmtbound float32 `nullable:"true" list:"domain"`
// 存储配置信息
StorageConf jsonutils.JSONObject `nullable:"true" get:"domain" list:"domain" update:"domain"`
@@ -734,9 +734,9 @@ func (self *SStorage) GetUsedCapacity(isReady tristate.TriState) int64 {
}
}
func (self *SStorage) GetOvercommitBound() float32 {
if self.Cmtbound > 0 {
return self.Cmtbound
func (storage *SStorage) GetOvercommitBound() float32 {
if storage.Cmtbound > 0 {
return storage.Cmtbound
} else {
return options.Options.DefaultStorageOvercommitBound
}