[PATCH ipmi-fru-parser] Using new getFRUOjbect() API to fix 'not found in lookup' error message

OpenBMC Patches openbmc-patches at stwcx.xyz
Mon Apr 11 19:50:13 AEST 2016


From: Yi Li <adamliyi at msn.com>

The ipmi-fru-parser calls the dbus method
SystemManager::getObjectFromId('FRU_STR', fru_area_name) for each fru areas
to get the dbus object path of fru area, even if the fru area does not exist.
Also ipmi_validate_fru_area() may be invoked multipul times before
full fru data is parsed. This will generate duplicated error
messages from SystemManager:, e.g:
"ERROR SystemManager: dbus.String(u'INTERNAL_13') not found in lookup".
In this case, "INTERNAL" area does not exists for FRU

For FRUs mananged by BMC (eeprom), ipmi-fru-parser sets the
'present' and 'fault' status of a fru area.
ipmi-fru-parser needs to know whether a fru should be present, based on
whether getObjectFromId() returns valid dbus object path.
So it is expected that getObjectFromId() may be called with
a 'fru_area_name' not defined in Skeleton's ID_LOOKUP table.

In another pull request for skeleton, a new method:
getFRUObject('fru_area_name') is added specially for ipmi-fru-parser.
See PR: https://github.com/openbmc/skeleton/pull/60.

This new method does not report any error message when 'fru_area_name'
not defined in skeleton.

Signed-off-by: Yi Li <adamliyi at msn.com>
---
 writefrudata.C | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/writefrudata.C b/writefrudata.C
index 8771a92..986b3d8 100644
--- a/writefrudata.C
+++ b/writefrudata.C
@@ -152,8 +152,8 @@ ipmi_fru::~ipmi_fru()
         }
         else
         {
-            printf("Present bit set to :[%s] for fruid:[%d]\n",
-                    iv_obj_path.c_str(), iv_fruid);
+            printf("Present bit set to :[%s] for fruid:[%d], Path[%s]:\n",
+                    present_bit, iv_fruid, iv_obj_path.c_str());
         }
 
         sd_bus_error_free(&bus_error);
@@ -184,12 +184,11 @@ int ipmi_fru::setup_sd_bus_paths(void)
                             sys_bus_name,               // Service to contact
                             sys_object_name,            // Object path
                             sys_intf_name,              // Interface name
-                            "getObjectFromId",          // Method to be called
+                            "getFRUObject",             // Method to be called
                             &bus_error,                 // object to return error
                             &response,                  // Response message on success
-                            "ss",                       // input message (string,string)
-                            "FRU_STR",                  // First argument to getObjectFromId
-                            fru_area_name);             // Second Argument
+                            "s",                        // input message (string)
+                            fru_area_name);             // Argument
 
     if(rc < 0)
     {
@@ -449,6 +448,7 @@ int ipmi_populate_fru_areas(uint8_t *fru_data, const size_t data_len,
     for(uint8_t fru_entry = IPMI_FRU_INTERNAL_OFFSET;
             fru_entry < (sizeof(struct common_header) -2); fru_entry++)
     {
+        rc = -1;
         // Actual offset in the payload is the offset mentioned in common header
         // multipled by 8. Common header is always the first 8 bytes.
         area_offset = fru_data[fru_entry] * IPMI_EIGHT_BYTES;
-- 
2.7.1




More information about the openbmc mailing list