482a8d7
commit fa1638452b8299f1a7f8e9a94259b25218a92acc
482a8d7
Author: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
482a8d7
Date:   Wed Jan 20 12:30:51 2021 +0530
482a8d7
482a8d7
    sysvpd: Add UUID property
482a8d7
    
482a8d7
    Recent LPARs contains "ibm,partition-uuid" device tree property.. which
482a8d7
    is unique UUID for each LPAR. This is represented by `MU` keyword.
482a8d7
    
482a8d7
    Lets add support to parse this property and populate vpddb.
482a8d7
    
482a8d7
    Ideally we should enhance libvpd to support new keyword. But that will
482a8d7
    add depedency on libvpd version. Hence adding this new keyword (MU)
482a8d7
    as DeviceSpecific keyword.
482a8d7
    
482a8d7
    Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
482a8d7
482a8d7
diff --git a/src/internal/sys_interface/devicetreecollector.cpp b/src/internal/sys_interface/devicetreecollector.cpp
482a8d7
index 6afbe85..db4e8b5 100644
482a8d7
--- a/src/internal/sys_interface/devicetreecollector.cpp
482a8d7
+++ b/src/internal/sys_interface/devicetreecollector.cpp
482a8d7
@@ -1215,6 +1215,12 @@ ERROR:
482a8d7
 				sys->mSerialNum2.setValue( val, 80 , __FILE__, __LINE__ );
482a8d7
 		}
482a8d7
 
482a8d7
+		val = getAttrValue("/proc/device-tree", "ibm,partition-uuid" );
482a8d7
+		if( val != "" )
482a8d7
+		{
482a8d7
+			setVPDField( sys, string("MU"), val, __FILE__, __LINE__ );
482a8d7
+		}
482a8d7
+
482a8d7
 		getSystemVPD(sys);
482a8d7
 	}
482a8d7
 
482a8d7
diff --git a/src/internal/sys_interface/icollector.cpp b/src/internal/sys_interface/icollector.cpp
482a8d7
index ffa2466..5c4dccc 100644
482a8d7
--- a/src/internal/sys_interface/icollector.cpp
482a8d7
+++ b/src/internal/sys_interface/icollector.cpp
482a8d7
@@ -313,6 +313,8 @@ namespace lsvpd
482a8d7
 		else if( key == "SE" ) {
482a8d7
 			sys->mSerialNum1.setValue( val, 70, file, lineNum );
482a8d7
 			sys->mProcessorID.setValue( val, 70, file, lineNum );
482a8d7
+		} else if ( key == "MU" ) {
482a8d7
+			sys->addDeviceSpecific( key, "UUID", val, 90 );
482a8d7
 		} else
482a8d7
 			/* XXX: Un-recognized key */
482a8d7
 			sys->addDeviceSpecific( key, "System Specific", val, 90 );