From f3b4b4d3146c9ac5b12bad89eb3d48842984aab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Wed, 12 Sep 2018 16:12:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=BF=E5=85=8D=E5=8F=AA=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E4=B8=AAstorage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/compute/models/hosts.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/compute/models/hosts.go b/pkg/compute/models/hosts.go index f4de4e2228..461918837a 100644 --- a/pkg/compute/models/hosts.go +++ b/pkg/compute/models/hosts.go @@ -529,7 +529,8 @@ func (self *SHost) GetAttachedStorageCapacity() SStorageCapacity { func _getLeastUsedStorage(storages []SStorage, backends []string) *SStorage { var best *SStorage var bestCap int - for _, s := range storages { + for i := 0; i < len(storages); i++ { + s := storages[i] if len(backends) > 0 { in, _ := utils.InStringArray(s.StorageType, backends) if !in {