Maor Lipchuk has posted comments on this change. Change subject: core: validate max lun disk attachment ......................................................................
Patch Set 3: (5 inline comments) minor comments, logic looks good, consider to add a test for the PCI and IDE .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddDiskCommand.java Line 146: Line 147: return returnValue; Line 148: } Line 149: Line 150: private boolean canDoAddSharableDisk() { /s/canDoAddSharableDisk/canDoAddShareableDisk Line 151: if (getParameters().getDiskInfo().isShareable()) { Line 152: if (!Config.<Boolean> GetValue(ConfigValues.ShareableDiskEnabled, Line 153: getStoragePool().getcompatibility_version().getValue())) { Line 154: addCanDoActionMessage(VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL); Line 151: if (getParameters().getDiskInfo().isShareable()) { Line 152: if (!Config.<Boolean> GetValue(ConfigValues.ShareableDiskEnabled, Line 153: getStoragePool().getcompatibility_version().getValue())) { Line 154: addCanDoActionMessage(VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL); Line 155: return false; Consider to use failCanDoAction here Line 156: } else if (!isVolumeFormatSupportedForShareable(((DiskImage) getParameters().getDiskInfo()).getvolume_format())) { Line 157: addCanDoActionMessage(VdcBllMessages.SHAREABLE_DISK_IS_NOT_SUPPORTED_BY_VOLUME_FORMAT); Line 158: return false; Line 159: } Line 154: addCanDoActionMessage(VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL); Line 155: return false; Line 156: } else if (!isVolumeFormatSupportedForShareable(((DiskImage) getParameters().getDiskInfo()).getvolume_format())) { Line 157: addCanDoActionMessage(VdcBllMessages.SHAREABLE_DISK_IS_NOT_SUPPORTED_BY_VOLUME_FORMAT); Line 158: return false; same here Line 159: } Line 160: } Line 161: return true; Line 162: } Line 160: } Line 161: return true; Line 162: } Line 163: Line 164: private boolean canDoExeedingMaxBlockDiskSize() { /s/Exeeding/Exceeding Line 165: if (isExceedMaxBlockDiskSize()) { Line 166: addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DISK_MAX_SIZE_EXCEEDED); Line 167: getReturnValue().getCanDoActionMessages().add( Line 168: String.format("$max_disk_size %1$s", Config.<Integer> GetValue(ConfigValues.MaxBlockDiskSize))); Line 182: Line 183: private boolean canDoFreeSpace() { Line 184: if (!hasFreeSpace(getStorageDomain())) { Line 185: addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW); Line 186: return false; Consider use failCanDoAction here (Maybe also ternary condition, like : return hasFreeSpace(getStorageDomain()) ? true : failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW) Line 187: } Line 188: return true; Line 189: } Line 190: -- To view, visit http://gerrit.ovirt.org/9409 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a82b3ed85c89beb8df70315ad457f54b366d69d Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Roy Golan <rgo...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Michal Skrivanek <michal.skriva...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com> Gerrit-Reviewer: Roy Golan <rgo...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches