Skip to content

Commit 4f957a4

Browse files
author
Dingane Hlaluku
committed
Fix unhandled NPE during VM migration
1 parent df30c81 commit 4f957a4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4720,8 +4720,11 @@ public Outcome<VirtualMachine> migrateVmThroughJobQueue(final String vmUuid, fin
47204720
final User user = context.getCallingUser();
47214721
final Account account = context.getCallingAccount();
47224722

4723-
for (StoragePool destPool : dest.getStorageForDisks().values()) {
4724-
checkConcurrentJobsPerDatastoreThreshhold(destPool);
4723+
Map<Volume, StoragePool> volumeStorageMap = dest.getStorageForDisks();
4724+
if (volumeStorageMap != null) {
4725+
for (Volume vol : volumeStorageMap.keySet()) {
4726+
checkConcurrentJobsPerDatastoreThreshhold(volumeStorageMap.get(vol));
4727+
}
47254728
}
47264729

47274730
final VMInstanceVO vm = _vmDao.findByUuid(vmUuid);

0 commit comments

Comments
 (0)