JoaoJandre commented on code in PR #13286:
URL: https://github.com/apache/cloudstack/pull/13286#discussion_r4259224764
##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java:
##########
@@ -655,6 +662,28 @@ public KVMStoragePool getStoragePool(String uuid, boolean
refreshInfo) {
}
}
+ private Long getBackingFileSizes(StoragePool pool, StorageVol vol) throws
LibvirtException {
+ long total = 0L;
+ Set<String> visited = new HashSet<>();
+ StorageVol current = vol;
+
+ while (current != null) {
+ total += current.getInfo().allocation;
+ String backingName = getBackingFileOfVolumeIfExists(current);
+ if (StringUtils.isBlank(backingName) || !visited.add(backingName))
{
+ break;
+ }
+ try {
+ current = getVolume(pool, backingName);
Review Comment:
If the backing file is not on the pool. Then the VM is inconsistent and
likely corrupt. This should never happen currently.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]