Ayal Baron has posted comments on this change.
Change subject: multipath: Remove unused 'deduceType'
......................................................................
Patch Set 1: (6 inline comments)
You're correct that DEV_MIXED is used as well as multipath.devIsiSCSI
....................................................
File vdsm/storage/multipath.py
Line 267: "capacity": str(getDeviceSize(dmId)),
Line 268: "serial": svdsm.getScsiSerial(dmId),
Line 269: "paths": [],
Line 270: "connections": [],
Line 271: "devtypes": [],
remove devtypes from here (never used)
Line 272: "devtype": "",
Line 273: "vendor": "",
Line 274: "product": "",
Line 275: "fwrev": "",
Line 275: "fwrev": "",
Line 276: "logicalblocksize": "",
Line 277: "physicalblocksize": "",
Line 278: }
Line 279:
add:
devtypes = set()
Line 280: for slave in devicemapper.getSlaves(dmId):
Line 281: if not devicemapper.isBlockDevice(slave):
Line 282: log.warning("No such physdev '%s' is ignored"
% slave)
Line 283: continue
Line 324:
Line 325: pathInfo["devnum"] =
DeviceNumber(*devicemapper.getDevNum(slave))
Line 326:
Line 327: if iscsi.devIsiSCSI(slave):
Line 328: devInfo["devtypes"].append(DEV_ISCSI)
s/.*/devtypes.update(DEV_ISCSI)/
Line 329: pathInfo["type"] = DEV_ISCSI
Line 330: sessionID = iscsi.getiScsiSession(slave)
Line 331: if sessionID not in knownSessions:
Line 332: # FIXME: This entire part is for BC. It should be moved to
Line 350:
Line 351: knownSessions[sessionID] = sessionInfo
Line 352:
devInfo["connections"].append(knownSessions[sessionID])
Line 353: else:
Line 354: devInfo["devtypes"].append(DEV_FCP)
s/.*/devtypes.update(DEV_FCP)/
Line 355: pathInfo["type"] = DEV_FCP
Line 356:
Line 357: if devInfo["devtype"] == "":
Line 358: devInfo["devtype"] = pathInfo["type"]
Line 353: else:
Line 354: devInfo["devtypes"].append(DEV_FCP)
Line 355: pathInfo["type"] = DEV_FCP
Line 356:
Line 357: if devInfo["devtype"] == "":
you can get rid of this entire section (if devInfo... devInfo.. == DEV_MIXED)
Line 358: devInfo["devtype"] = pathInfo["type"]
Line 359: elif (devInfo["devtype"] != DEV_MIXED and
Line 360: devInfo["devtype"] != pathInfo["type"]):
Line 361: devInfo["devtype"] == DEV_MIXED
Line 360: devInfo["devtype"] != pathInfo["type"]):
Line 361: devInfo["devtype"] == DEV_MIXED
Line 362:
Line 363: devInfo["paths"].append(pathInfo)
Line 364:
and add following (only evaluated once after 'for' loop:
if len(devtypes) > 1:
devInfo["devtype"] = DEV_MIXED
else:
devInfo["devtype"] = devtypes.pop()
Line 365: yield devInfo
Line 366:
Line 367:
Line 368: def pathinfo(guid):
--
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