Skip to content

Commit 44c73fd

Browse files
author
Marcus Sorensen
committed
CLOUDSTACK-5430: NPE can be thrown in disconnectPhysicalDiskViaVmSpec in
certain failure scenarios. This can only be triggered if other bugs allow pools to be deleted while VMs are using them.
1 parent 4bb85cd commit 44c73fd

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ public boolean disconnectPhysicalDisksViaVmSpec(VirtualMachineTO vmSpec) {
178178

179179
KVMStoragePool pool = getStoragePool(store.getPoolType(), store.getUuid());
180180

181+
if (pool == null) {
182+
s_logger.error("Pool " + store.getUuid() + " of type " + store.getPoolType() + " was not found, skipping disconnect logic");
183+
continue;
184+
}
185+
181186
StorageAdaptor adaptor = getStorageAdaptor(pool.getType());
182187

183188
// if a disk fails to disconnect, still try to disconnect remaining

0 commit comments

Comments
 (0)