Skip to content

Commit bf1ff10

Browse files
committed
Merge branch '4.19' into 4.20
2 parents d9a7b6e + e278bcd commit bf1ff10

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,13 @@ private List<String> getAllowedInternalSiteCidrs() {
400400
}
401401
String[] cidrs = _allowedInternalSites.split(",");
402402
for (String cidr : cidrs) {
403-
if (NetUtils.isValidIp4Cidr(cidr) || NetUtils.isValidIp4(cidr) || !cidr.startsWith("0.0.0.0")) {
404-
if (NetUtils.getCleanIp4Cidr(cidr).equals(cidr)) {
405-
logger.warn(String.format("Invalid CIDR %s in %s", cidr, SecStorageAllowedInternalDownloadSites.key()));
403+
if (NetUtils.isValidIp4Cidr(cidr) && !cidr.startsWith("0.0.0.0")) {
404+
if (! NetUtils.getCleanIp4Cidr(cidr).equals(cidr)) {
405+
logger.warn("Invalid CIDR {} in {}", cidr, SecStorageAllowedInternalDownloadSites.key());
406406
}
407+
allowedCidrs.add(NetUtils.getCleanIp4Cidr(cidr));
408+
} else if (NetUtils.isValidIp4(cidr) && !cidr.startsWith("0.0.0.0")) {
409+
logger.warn("Ip address is not a valid CIDR; {} consider using {}/32", cidr, cidr);
407410
allowedCidrs.add(cidr);
408411
}
409412
}

vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,9 +3167,12 @@ public int getFreeUnitNumberOnIDEController(int controllerKey) throws Exception
31673167

31683168
int deviceCount = 0;
31693169
int ideDeviceUnitNumber = -1;
3170-
if (devices != null && devices.size() > 0) {
3170+
if (devices != null) {
31713171
for (VirtualDevice device : devices) {
3172-
if (device instanceof VirtualDisk && (controllerKey == device.getControllerKey())) {
3172+
if (device.getControllerKey() == null || device.getControllerKey() != controllerKey) {
3173+
continue;
3174+
}
3175+
if (device instanceof VirtualDisk || device instanceof VirtualCdrom) {
31733176
deviceCount++;
31743177
ideDeviceUnitNumber = device.getUnitNumber();
31753178
}

0 commit comments

Comments
 (0)