Allon Mureinik has posted comments on this change. Change subject: core: validate that lun has a valid LunType ......................................................................
Patch Set 2: (3 inline comments) .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddDiskCommand.java Line 98: private boolean checkIfLunDiskCanBeAdded() { Line 99: LUNs lun = ((LunDisk) getParameters().getDiskInfo()).getLun(); Line 100: if (lun.getLunType() == StorageType.UNKNOWN) { Line 101: addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE); Line 102: return false; why not use failCanDoAction(message)? Line 103: } Line 104: if (getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) != null) { Line 105: addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_IS_ALREADY_IN_USE); Line 106: return false; Line 102: return false; Line 103: } Line 104: if (getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) != null) { Line 105: addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_IS_ALREADY_IN_USE); Line 106: return false; here too Line 107: } Line 108: return true; Line 109: } Line 110: .................................................... Commit Message Line 9: adding lun disk through rest API could be done with no lun type which Line 10: led to save the lun connections with UNKNOWN lun type. Having the lun Line 11: connections without 'real' type caused to NPE in various cases. Line 12: Line 13: Change-Id: I302b399fd93419fb1f621fd315b50d5971ae9c11 No Bug-Url? -- To view, visit http://gerrit.ovirt.org/8437 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I302b399fd93419fb1f621fd315b50d5971ae9c11 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Michael Kublin <mkub...@redhat.com> Gerrit-Reviewer: Tal Nisan <tni...@redhat.com> Gerrit-Reviewer: Vered Volansky <vvola...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches