mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): hugepage validate mem update
This commit is contained in:
@@ -710,7 +710,10 @@ func (self *SHost) IsHugePage() bool {
|
||||
}
|
||||
|
||||
func (self *SHost) GetMemoryOvercommitBound() float32 {
|
||||
if self.MemCmtbound > 0 && self.IsHugePage() {
|
||||
if self.IsHugePage() {
|
||||
return 1.0
|
||||
}
|
||||
if self.MemCmtbound > 0 {
|
||||
return self.MemCmtbound
|
||||
}
|
||||
return options.Options.DefaultMemoryOvercommitBound
|
||||
@@ -3654,8 +3657,8 @@ func (self *SHost) ValidateUpdateData(ctx context.Context, userCred mcclient.Tok
|
||||
return input, errors.Wrap(err, "inputUniquenessCheck")
|
||||
}
|
||||
|
||||
if self.IsHugePage() && (input.MemReserved != "" || input.MemCmtbound != nil) {
|
||||
return input, errors.Errorf("host mem is hugepage, cannot update mem_reserved or mem_cmtbound")
|
||||
if self.IsHugePage() && input.MemCmtbound != nil {
|
||||
return input, errors.Errorf("host mem is hugepage, cannot update mem_cmtbound")
|
||||
}
|
||||
|
||||
input.HostSizeAttributes, err = HostManager.ValidateSizeParams(input.HostSizeAttributes)
|
||||
|
||||
Reference in New Issue
Block a user