From f5a8a079dff00e3d71631a9d8899bfa5c11028e1 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Wed, 15 Nov 2017 15:40:02 +0530 Subject: [PATCH] Add host number in device location code to distinguish different devices This patch adds host number in location code as well to differentiate two different devices if both has same bus, target and lun number. H1-B0-T0-L0 [on] H0-B0-T0-L0 [off] Signed-off-by: Ankit Kumar [Added host value check and removing hyphen so that location code start with H - Vasant] Signed-off-by: Vasant Hegde --- ppc64-diag/src/internal/sys_interface/devicetreecollector.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/internal/sys_interface/devicetreecollector.cpp b/src/internal/sys_interface/devicetreecollector.cpp index dc7ff54..6afbe85 100644 --- a/src/internal/sys_interface/devicetreecollector.cpp +++ b/src/internal/sys_interface/devicetreecollector.cpp @@ -765,7 +765,7 @@ ERROR: { Component *parent; ostringstream val; - const DataItem *target, *lun, *bus; + const DataItem *target, *lun, *bus, *host; /* Build up a distinct YL based on parents YL - for device such as * scsi, ide, usb, etc that do not generate ibm,loc-code @@ -778,7 +778,9 @@ ERROR: target = fillMe->getDeviceSpecific("XT"); lun = fillMe->getDeviceSpecific("XL"); bus = fillMe->getDeviceSpecific("XB"); - if (target != NULL && lun != NULL && bus != NULL) { + host = fillMe->getDeviceSpecific("XH"); + if (host != NULL && target != NULL && + lun != NULL && bus != NULL) { if (fillMe->mPhysicalLocation.dataValue != "") val << fillMe->mPhysicalLocation.dataValue; else if @@ -787,8 +789,8 @@ ERROR: else val << getAttrValue( parent->deviceTreeNode.dataValue, "ibm,loc-code" ); - val << "-B" << bus->dataValue << "-T" << target->dataValue - << "-L" << lun->dataValue; + val << "H" << host->dataValue << "-B" << bus->dataValue + << "-T" << target->dataValue << "-L" << lun->dataValue; fillMe->mPhysicalLocation.setValue( val.str( ), 60 , __FILE__, __LINE__ ); } -- 2.9.3