Skip to content

Commit c9a09f5

Browse files
committed
CLOUDSTACK-6579: used_bytes column of storage_pool table is no longer used and should be removed
For now correctly setting used_bytes. Also fixed the corresponding simulator code
1 parent 59bf355 commit c9a09f5

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultHostListener.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public boolean hostConnect(long hostId, long poolId) {
8181
}
8282

8383
StoragePoolVO poolVO = this.primaryStoreDao.findById(poolId);
84-
poolVO.setUsedBytes(mspAnswer.getPoolInfo().getAvailableBytes());
84+
poolVO.setUsedBytes(mspAnswer.getPoolInfo().getCapacityBytes() - mspAnswer.getPoolInfo().getAvailableBytes());
8585
poolVO.setCapacityBytes(mspAnswer.getPoolInfo().getCapacityBytes());
8686
primaryStoreDao.update(pool.getId(), poolVO);
8787

‎plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ public ModifyStoragePoolAnswer ModifyStoragePool(ModifyStoragePoolCommand cmd) {
362362
txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
363363
txn.close();
364364
}
365-
return new ModifyStoragePoolAnswer(cmd, storagePool.getCapacity(), 0, new HashMap<String, TemplateProp>());
365+
return new ModifyStoragePoolAnswer(cmd, storagePool.getCapacity(), storagePool.getCapacity(), new HashMap<String, TemplateProp>());
366366
}
367367

368368
@Override
@@ -964,7 +964,7 @@ public StoragePoolInfo getLocalStorage(String hostGuid) {
964964
}
965965
}
966966
return new StoragePoolInfo(storagePool.getUuid(), host.getPrivateIpAddress(), storagePool.getMountPoint(), storagePool.getMountPoint(),
967-
storagePool.getPoolType(), storagePool.getCapacity(), 0);
967+
storagePool.getPoolType(), storagePool.getCapacity(), storagePool.getCapacity());
968968
}
969969

970970
@Override

0 commit comments

Comments
 (0)