Source:
<code>public static ValidationResult setAndValidateDiskProfiles(Map<DiskImage, Guid> map, Version version, DbUser user) { if (map == null || !FeatureSupported.storageQoS(version)) { return ValidationResult.VALID; } Map<Guid, List<DiskProfile>> storageDiskProfilesMap = new HashMap<>(); Set<Guid> permittedDiskProfilesIds = new HashSet<>(); for (Entry<DiskImage, Guid> entry : map.entrySet()) { DiskImage diskImage = entry.getKey(); Guid storageDomainId = entry.getValue(); if (diskImage.getDiskStorageType() != DiskStorageType.IMAGE) { continue; <START> } <END> if (diskImage.getDiskProfileId() == null && storageDomainId != null) { List<DiskProfile> diskProfilesList = storageDiskProfilesMap.get(storageDomainId); if (diskProfilesList == null) { diskProfilesList = getDiskProfileDao().getAllForStorageDomain(storageDomainId); storageDiskProfilesMap.put(storageDomainId, diskProfilesList); } if (!updateDiskProfileForBackwardCompatibility(diskImage, diskProfilesList, permittedDiskProfilesIds, user)) { return new ValidationResult(VdcBllMessages.USER_NOT_AUTHORIZED_TO_ATTACH_DISK_PROFILE); } } else { DiskProfile diskProfile = getDiskProfileDao().get(diskImage.getDiskProfileId()); ValidationResult result = new DiskProfileValidator(diskProfile).isParentEntityValid(storageDomainId); if (result != ValidationResult.VALID) { return result; } if (!isDiskProfilePermitted(diskProfile, permittedDiskProfilesIds, user)) { return new ValidationResult(VdcBllMessages.USER_NOT_AUTHORIZED_TO_ATTACH_DISK_PROFILE); } } } return ValidationResult.VALID; }</code><technical_language>please move this if beginning of for loop (after line 47), consider add info log "Disk {alias name} type is supported disk profile"</technical_language>

Target:
public static ValidationResult setAndValidateDiskProfiles(Map<DiskImage, Guid> map, Version version, DbUser user) { if (map == null || !FeatureSupported.storageQoS(version)) { return ValidationResult.VALID; } Map<Guid, List<DiskProfile>> storageDiskProfilesMap = new HashMap<>(); Set<Guid> permittedDiskProfilesIds = new HashSet<>(); for (Entry<DiskImage, Guid> entry : map.entrySet()) { DiskImage diskImage = entry.getKey(); Guid storageDomainId = entry.getValue(); if (diskImage.getDiskStorageType() != DiskStorageType.IMAGE) { log.info("Disk profiles is not supported for storage type '{}' (Disk '{}')", diskImage.getDiskStorageType(), diskImage.getDiskAlias()); continue; } if (diskImage.getDiskProfileId() == null && storageDomainId != null) { List<DiskProfile> diskProfilesList = storageDiskProfilesMap.get(storageDomainId); if (diskProfilesList == null) { diskProfilesList = getDiskProfileDao().getAllForStorageDomain(storageDomainId); storageDiskProfilesMap.put(storageDomainId, diskProfilesList); } if (!updateDiskProfileForBackwardCompatibility(diskImage, diskProfilesList, permittedDiskProfilesIds, user)) { return new ValidationResult(VdcBllMessages.USER_NOT_AUTHORIZED_TO_ATTACH_DISK_PROFILE); } } else { DiskProfile diskProfile = getDiskProfileDao().get(diskImage.getDiskProfileId()); ValidationResult result = new DiskProfileValidator(diskProfile).isParentEntityValid(storageDomainId); if (result != ValidationResult.VALID) { return result; } if (!isDiskProfilePermitted(diskProfile, permittedDiskProfilesIds, user)) { return new ValidationResult(VdcBllMessages.USER_NOT_AUTHORIZED_TO_ATTACH_DISK_PROFILE); } } } return ValidationResult.VALID; }