Eduardo has posted comments on this change.
Change subject: multipath: Remove unused 'deduceType'
......................................................................
Patch Set 1:
Part 1.
1) DEV_MIXED is used (set) in hsm _only_.
Therefore can be removed from multipath. multipath does not return such value when
deduceType() is removed.
2) In hsm is used only for marking VGs composed from luns with different connection types,
which I'm think it's unsupported.
3) Looking at the code:
2775) for vgInfo in vgInfos:
2776) for pv in lvm.listPVNames(vgInfo['name']):
2784) elif (vgType != multipath.DEV_MIXED and
2785) vgType != dev["devtype"]):
2786) vgType = multipath.DEV_MIXED
2791) if vgType == multipath.DEV_FCP:
1817) typeFilter = \
2793) elif vgType == multipath.DEV_ISCSI:
2795) else:
2796) # TODO: Allow for mixed vgs to be specified as such in the API
2797) vgType = sd.ISCSI_DOMAIN
If DEV_MIXED was set (2) it is overriden at the end of the loop!
Therefore, if (2) is supported vgType = sd.ISCSI_DOMAIN should be set in 2786 and
DEV_MIXED can be safely removed from hsm too.
4) In such case:
2773) def __processVGInfos(self, vgInfos, pathDict, getGuid):
existence should be revised, changing the definitions of multipath.DEV_ISCSI and
multipath.DEV_FCP to be identical values as sd.ISCSI_DOMAIN and sd.FCP_DOMAIN and
removing:
2769) self.__processVGInfos(vgInfos, pathDict, getGuid)
and the whole __processVGInfos() function.
Part 2.
About multipath.devIsiSCSI() and multipath.devIsFCP()
5) Removing DEV_MIXED by (1) and using (4), arcane lambda functions can be removed:
1812) def _getDeviceList(self, storageType=None, guids=None):
1814) typeFilter = lambda dev: True
1815) if storageType:
1816) if sd.storageType(storageType) == sd.type2name(sd.ISCSI_DOMAIN):
1817) typeFilter = \
1818) lambda dev: multipath.devIsiSCSI(dev.get("devtype"))
1819) elif sd.storageType(storageType) == sd.type2name(sd.FCP_DOMAIN):
1820) typeFilter = \
1821) lambda dev: multipath.devIsFCP(dev.get("devtype"))
6) replacing:
1842) if not typeFilter(dev):
1843) continue
by:
if storageType != None and dev["devtype"] != storageType:
continue
7) And then multipath.devIsiSCSI() and multipath.devIsFCP() can be removed.
--
To view, visit
http://gerrit.ovirt.org/13363
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37a94c3d67641f1c78d8fbecd63cbf1480c6e1b0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server