Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions server/src/main/java/com/cloud/server/ManagementServerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
import javax.inject.Inject;
import javax.naming.ConfigurationException;

import com.cloud.storage.ScopeType;
import com.cloud.hypervisor.kvm.dpdk.DpdkHelper;
import org.apache.cloudstack.acl.ControlledEntity;
import org.apache.cloudstack.affinity.AffinityGroupProcessor;
import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao;
Expand Down Expand Up @@ -613,6 +611,7 @@
import com.cloud.hypervisor.HypervisorCapabilities;
import com.cloud.hypervisor.HypervisorCapabilitiesVO;
import com.cloud.hypervisor.dao.HypervisorCapabilitiesDao;
import com.cloud.hypervisor.kvm.dpdk.DpdkHelper;
import com.cloud.info.ConsoleProxyInfo;
import com.cloud.network.IpAddress;
import com.cloud.network.dao.IPAddressDao;
Expand All @@ -639,6 +638,7 @@
import com.cloud.storage.GuestOSHypervisorVO;
import com.cloud.storage.GuestOSVO;
import com.cloud.storage.GuestOsCategory;
import com.cloud.storage.ScopeType;
import com.cloud.storage.StorageManager;
import com.cloud.storage.StoragePool;
import com.cloud.storage.Volume;
Expand Down Expand Up @@ -1442,7 +1442,11 @@ public Pair<List<? extends StoragePool>, List<? extends StoragePool>> listStorag
StoragePool srcVolumePool = _poolDao.findById(volume.getPoolId());
allPools = getAllStoragePoolCompatileWithVolumeSourceStoragePool(srcVolumePool);
allPools.remove(srcVolumePool);
suitablePools = findAllSuitableStoragePoolsForVm(volume, vm, srcVolumePool);
if (vm != null) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One liner improvement if you have some time: suitablePools = vm == null ? allPools : findAllSuitableStoragePools(....)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can consider it in the future, I generally like to avoid ternary operator which reduces code readability.

suitablePools = findAllSuitableStoragePoolsForVm(volume, vm, srcVolumePool);
} else {
suitablePools = allPools;
}

return new Pair<List<? extends StoragePool>, List<? extends StoragePool>>(allPools, suitablePools);
}
Expand Down