open-hpi / openhpi

Other
7 stars 10 forks source link

saHpiIdrFieldGet() fails with NOT_PRESENT error #622

Closed mohandev2 closed 6 years ago

mohandev2 commented 19 years ago

On the BCT3 test run on 11/19/2004, saHpiIdrFieldGet_T1 test failed "call returns error when attempting to get a IDR field! Error code -- SA_ERR_HPI_NOT_PRESENT returned"

Reported by: carlmc1

Original Ticket: "openhpi/bugs/622":https://sourceforge.net/p/openhpi/bugs/622

mohandev2 commented 19 years ago

Original comment by: pdphan

mohandev2 commented 19 years ago

Logged In: YES user_id=901950

I believe this is testcase error. Testcase attempts saHpiFieldGet() with (AreaId == SAHPI_FIRST_ENTRY && FieldId == SAHPI_FIRST_ENTRY). Specification does not allow for AreaId == SAHPI_FIRST_ENTRY.

Rather, use saHpiIdrAreaHeaderGet() with AreaId == SAHPI_FIRST_ENTRY to obtain a valid AreaId. Then saHpiFieldGet() with valid-AreaId and FieldId == SAHPI_FIRST_ENTRY.

Original comment by: pdphan

mohandev2 commented 19 years ago

Logged In: YES user_id=1000392

Bug 1076825 saHpiIdrFieldGet() fails with NOT_PRESENT error

A return of SA_ERR_HPI_NOT_PRESENT implies that the IDR Area does not have any Field instances. Since an IDR Area is composed of an Area Header and one or more Inventory Data Fields (HPI 'B' spec pg 98 at the bottom), this is an invalid error return for the saHpiIdrFieldGet call.

It is my feeling, that if you don't have a field to populate an Area, then we should not have the area defined.

There is a problem with my solution. There is a function to add an IDR area. This call does not automatically generate a field in the area. So, if the application/user can create an area without a field, then we should support it.

There is another solution. Whenever we create a new Area, a dummy field is always created in it. This dummy field could be replaced when the App/User creates the first field in the area. The created dummy field could be of type SAHPI_IDR_FIELDTYPE_CUSTOM and have the text: "There are no valid fields in this area" as the string in English. This dummy field should be read-only and have an architected FieldID assigned to it so our code could easily identify it. I would suggest (SAHPI_LAST_ENTRY - 1).

Carl McAdams Software Engineer IBM Xseries TELCO Systems and Solutions 11400 BURNET ROAD, AUSTIN, TX 78758, USA (512)823-3319 carlmc@us.ibm.com

Original comment by: carlmc1

mohandev2 commented 19 years ago

Original comment by: carlmc1