Skip to content

Commit defb879

Browse files
review comments
1 parent 637077e commit defb879

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

server/src/main/java/com/cloud/storage/StorageManagerImpl.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,8 @@ public List<StoragePoolVO> ListByDataCenterHypervisor(long datacenterId, Hypervi
503503
public boolean isLocalStorageActiveOnHost(Long hostId) {
504504
List<StoragePoolHostVO> storagePoolHostRefs = _storagePoolHostDao.listByHostId(hostId);
505505
for (StoragePoolHostVO storagePoolHostRef : storagePoolHostRefs) {
506-
StoragePoolVO PrimaryDataStoreVO = _storagePoolDao.findById(storagePoolHostRef.getPoolId());
507-
if (PrimaryDataStoreVO != null && (PrimaryDataStoreVO.getPoolType() == StoragePoolType.LVM || PrimaryDataStoreVO.getPoolType() == StoragePoolType.EXT)) {
506+
StoragePoolVO primaryDataStoreVO = _storagePoolDao.findById(storagePoolHostRef.getPoolId());
507+
if (primaryDataStoreVO != null && (primaryDataStoreVO.getPoolType() == StoragePoolType.LVM || primaryDataStoreVO.getPoolType() == StoragePoolType.EXT)) {
508508
SearchBuilder<VolumeVO> volumeSB = volumeDao.createSearchBuilder();
509509
volumeSB.and("poolId", volumeSB.entity().getPoolId(), SearchCriteria.Op.EQ);
510510
volumeSB.and("removed", volumeSB.entity().getRemoved(), SearchCriteria.Op.NULL);
@@ -515,7 +515,7 @@ public boolean isLocalStorageActiveOnHost(Long hostId) {
515515
volumeSB.join("activeVmSB", activeVmSB, volumeSB.entity().getInstanceId(), activeVmSB.entity().getId(), JoinBuilder.JoinType.INNER);
516516

517517
SearchCriteria<VolumeVO> volumeSC = volumeSB.create();
518-
volumeSC.setParameters("poolId", PrimaryDataStoreVO.getId());
518+
volumeSC.setParameters("poolId", primaryDataStoreVO.getId());
519519
volumeSC.setParameters("state", Volume.State.Expunging, Volume.State.Destroy);
520520
volumeSC.setJoinParameters("activeVmSB", "state", State.Starting, State.Running, State.Stopping, State.Migrating);
521521

@@ -2134,9 +2134,9 @@ public String getPrimaryStorageNameLabel(VolumeVO volume) {
21342134
// poolId is null only if volume is destroyed, which has been checked
21352135
// before.
21362136
assert poolId != null;
2137-
StoragePoolVO PrimaryDataStoreVO = _storagePoolDao.findById(poolId);
2138-
assert PrimaryDataStoreVO != null;
2139-
return PrimaryDataStoreVO.getUuid();
2137+
StoragePoolVO primaryDataStoreVO = _storagePoolDao.findById(poolId);
2138+
assert primaryDataStoreVO != null;
2139+
return primaryDataStoreVO.getUuid();
21402140
}
21412141

21422142
@Override
@@ -2689,8 +2689,8 @@ public CapacityVO getStoragePoolUsedStats(Long poolId, Long clusterId, Long podI
26892689
}
26902690

26912691
CapacityVO capacity = new CapacityVO(poolId, zoneId, podId, clusterId, 0, 0, Capacity.CAPACITY_TYPE_STORAGE);
2692-
for (StoragePoolVO PrimaryDataStoreVO : pools) {
2693-
StorageStats stats = ApiDBUtils.getStoragePoolStatistics(PrimaryDataStoreVO.getId());
2692+
for (StoragePoolVO primaryDataStoreVO : pools) {
2693+
StorageStats stats = ApiDBUtils.getStoragePoolStatistics(primaryDataStoreVO.getId());
26942694
if (stats == null) {
26952695
continue;
26962696
}

0 commit comments

Comments
 (0)