Maor Lipchuk has posted comments on this change. Change subject: core: Fix IndexOutOfBoundsException in plug FC disk ......................................................................
Patch Set 5: (5 inline comments) .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractDiskVmCommand.java Line 67: getVm().getId(), disk, vmDevice)); Line 68: } Line 69: Line 70: /** Line 71: * If the LUN has no connections we assume that it is FCP storage type, since FCP does not represent connections, does/doesn't - no s/represent/have - done Line 72: * otherwise, we return the storage type of the first connection Line 73: * Line 74: * @param lun Line 75: * - The lun we set the connection at. Line 74: * @param lun Line 75: * - The lun we set the connection at. Line 76: * @return The storage type of the lun (ISCSI or FCP). Line 77: */ Line 78: protected StorageType getLUNStorageType(LUNs lun) { Flows are already known, it is being used after the set. Line 79: return lun.getLunConnections().isEmpty() ? StorageType.FCP : lun.getLunConnections().get(0).getstorage_type(); Line 80: } Line 81: Line 82: /** Line 81: Line 82: /** Line 83: * Sets the LUN connection list from the DB. Line 84: * Line 85: * @param lun Formatter default Line 86: * - The lun we set the connection at. Line 87: */ Line 88: private void updateLUNConnectionsInfo(LUNs lun) { Line 89: lun.setLunConnections(new ArrayList<storage_server_connections>(getDbFacade() .................................................... File backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/HotPlugDiskToVmCommandTest.java Line 87: public void getFCStorageTypeForLun() throws Exception { Line 88: LUNs lun = new LUNs(); Line 89: ArrayList<storage_server_connections> connections = new ArrayList<storage_server_connections>(); Line 90: lun.setLunConnections(connections); Line 91: StorageType storageType = command.getLUNStorageType(lun); done Line 92: assertEquals("Lun disk should be of FC storage type since it does not had connections", Line 93: storageType, Line 94: storageType.FCP); Line 95: } Line 93: storageType, Line 94: storageType.FCP); Line 95: } Line 96: Line 97: @Test done Line 98: public void getISCSIStorageTypeForLun() throws Exception { Line 99: LUNs lun = new LUNs(); Line 100: ArrayList<storage_server_connections> connections = new ArrayList<storage_server_connections>(); Line 101: connections.add(new storage_server_connections("Some LUN connection", -- To view, visit http://gerrit.ovirt.org/9724 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6414445b9a74be299205ff7fc9a21d1388a29687 Gerrit-PatchSet: 5 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Ayal Baron <aba...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Eduardo <ewars...@redhat.com> Gerrit-Reviewer: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Sharad Mishra <snmis...@linux.vnet.ibm.com> Gerrit-Reviewer: Vered Volansky <vvola...@redhat.com> Gerrit-Reviewer: liron aravot <liron.ara...@gmail.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches