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 <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches