summaryrefslogtreecommitdiffstats
path: root/read_fru_data.cpp
Commit message (Collapse)AuthorAgeFilesLines
* fru: remove assumption on object ownerPatrick Venture2019-08-011-7/+25
| | | | | | | | | | | | | The fru read yaml configuration allows specifying a dbus path and a dbus interface. Dynamically look up what service provides that interface with that dbus path. Continue supporting partial paths for devices owned by the Inventory Manager. Tested: Verified the module now reads the FRU properties over dbus if the object is owned by another service (exported via entity-manager). Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I5c0aeb11d0b33fab437a55dea3351a47feab0783
* fru: use ipmifruproperty for property lookupPatrick Venture2019-08-011-2/+3
| | | | | | | | | | | | | | | | | | The member IPMIFruData::property was unused and instead the property lookup was performed with the phosphor-dbus-interface property name. The IPMIFruData::property field is meant to map from dbus property to FRU property to allow a variety of dbus mappings. Tested: Verified the member was unused. Tested: Verified that a configuration yaml mapping is respected and ipmid will report the information expected given a FRU published to dbus. Note: The fields for IPMI FRU properties were taken from the example YAML and are expected to be what was used by machines leveraging this feature. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I44f73b67ecdeae2d772daa38cc21cc18cdf9c7ce
* move variant to std namespaceVernon Mauery2019-04-181-5/+2
| | | | | | | | | | | sdbusplus::message::variant_ns has been std for a while now. This moves ipmid away from sdbusplus::message::variant_ns to directly use std::variant. Tested-by: built, compiles, and runs the same as before. Change-Id: I8caa945f31c926c2721319f001b9d7f83fd3f1b7 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Only include ipmid/api.hpp for the new APIVernon Mauery2019-04-081-2/+1
| | | | | | | | | | | | | | After some feedback from users of the new IPMI API, they wanted to see two things: 1) don't require ipmid/api.hpp and ipmid/registration.hpp to be able to write new handlers 2) only require including ipmid/api.hpp (instead of ipmid/api.h) So now, by simply including ipmid/api.hpp instead of ipmid/api.h (deprecated), handlers incorporating the new IPMI API can be written. Change-Id: I446dcce70cff03d4ecc28c658292d052485f77fc Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* move types.hpp to ipmid/types.hpp for exportVernon Mauery2019-03-251-1/+1
| | | | | | | | | | types.hpp is required by utility.hpp, which is exported, so it needs to be exported as well. This moves it to the include/libipmid directory, changes the Makefile to export it, and changes all the files that include it so it can be found in the right place. Change-Id: I30ec365446e4de466c266ec4faa327478460ec05 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Move util.cpp/util.hpp to libipmidVernon Mauery2019-03-251-1/+1
| | | | | | | | | | | | | | | | These are functions that are used widely by ipmid providers, so it makes sense to put them in libipmi.so (the library that all providers must link against). Tested-by: use nm to inspect the binaries to see that the symbols are in the expected library. arm-openbmc-linux-gnueabi-nm libipmid.so.0.0.0 \ | grep getDbusObject 0001063c T _ZN4ipmi13getDbusObjectERN9sdbusplus.... Change-Id: I1221f807f2711c5301c5574623564ea1ae48a437 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Set init_priority attribute for global variables in shared libLei YU2019-02-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The code gets unspecified initializatio order for the global/static variables in a shared library. If unluck, a global/static variable may be initialized in *constructor* function, and then initialized by the default contructor. For exmaple, if `std::unique_ptr<xxx> var{nullptr};` is initialized in constructor function, below init order may occur: 1. It is initialized in constructor; 2. Then it is initialized as nullptr; And eventually when the code is to use the variable, we got nullptr. We met such issues before on openbmc/openbmc#1581, and the technical details could be found at [this SO question][1] and [this gcc email][2] The solution is to specify the init_priority attribute, to make the global/staic variables inititalize earlier than the contructors. [1]: https://stackoverflow.com/questions/43941159/global-static-variables-initialization-issue-with-attribute-constructor-i [2]: https://gcc.gnu.org/ml/gcc-patches/2017-03/msg00863.html Change-Id: I901a6a5cddec12aec9512fe58b16735fa2ad90d7 Signed-off-by: Lei YU <mine260309@gmail.com>
* Create libipmid and libipmid-hostWilliam A. Kennington III2019-02-071-1/+1
| | | | | | | | | | | | | | | | | | | This starts a transition to common ipmid libraries that providers can link against. It will allow for a cleaner separation between common ipmid functionality and daemon type specific code. This is needed so we can resolve all of the symbols in the providers at link time instead of discovering bad linkage by building and running a full ipmi daemon. In future commits libraries will be packaged for libipmid and libipmid-host which provide all of the symbols used by the current set of ipmid providers. This is the first step, it just separates and renames the headers. Legacy symlinks are still kept around for compatability. It also adds stub libraries so that external users can start linking as intended. Change-Id: I6bbd7a146362012d26812a7b039d1c4075862cbd Signed-off-by: William A. Kennington III <wak@google.com>
* read_fru_data: use structured bindings in fru loopPatrick Venture2018-11-071-5/+1
| | | | | | | Use structured bindings for first/second in fru loop. Change-Id: Ief5460946ead910ccae653ebb6f9d894805b756d Signed-off-by: Patrick Venture <venture@google.com>
* read_fru_data: use std::find_if instead of raw loopPatrick Venture2018-11-071-10/+7
| | | | | | | Use std::find_if to find matching item instead of using a raw loop. Change-Id: I1814d66dc8c6b33cb8ea12317105dfa70c47fe60 Signed-off-by: Patrick Venture <venture@google.com>
* cleanup: scope reductionPatrick Venture2018-10-311-1/+2
| | | | | | | | | | | | | | [app/channel.cpp:102]: (style) The scope of the variable 'resp' can be reduced. [ipmisensor.cpp:310]: (style) The scope of the variable 'i' can be reduced. [ipmid.cpp:506]: (style) The scope of the variable 'num_handlers' can be reduced. [read_fru_data.cpp:82]: (style) The scope of the variable 'fruId' can be reduced. [sensorhandler.cpp:256]: (style) The scope of the variable 'p' can be reduced. [storageaddsel.cpp:68]: (style) The scope of the variable 'p' can be reduced. Also delete two extra vertical lines. Change-Id: I8e72f8e1d94381f456674abf523d2f2fbdd8046d Signed-off-by: Patrick Venture <venture@google.com>
* Convert variant usage to std interfaceWilliam A. Kennington III2018-10-181-2/+6
| | | | | | | | | | | | | This is just a refactoring to use the c++17 std::variant interfaces instead of the mapbox::variant specific ones. We should be able to use mapbox::variant and std::variant interchangeably now. Tested: Built against sdbusplus with mapbox::variant and sbusplus using std::variant. Both variant compile and test out. Change-Id: I6fbaad3d12dd34968db6a10f3d74a65e07d0f0cc Signed-off-by: William A. Kennington III <wak@google.com>
* rename headers to match stylePatrick Venture2018-09-251-2/+2
| | | | | | | | | | | | | | | | | | Moving headers from ".h" to ".hpp" Reworked the header inclusion a bit so that host-ipmid is treated as a library, and local headers aren't. renamed apphandler.h => apphandler.hpp renamed chassishandler.h => chassishandler.hpp renamed globalhandler.h => globalhandler.hpp renamed sensorhandler.h => sensorhandler.hpp renamed storageaddsel.h => storageaddsel.hpp renamed storagehandler.h => storagehandler.hpp renamed systemintfcmds.h => systemintfcmds.hpp Change-Id: I9d4ce3dd57e2e996800f9020a10cc10cdf2c3914 Signed-off-by: Patrick Venture <venture@google.com>
* add .clang-formatPatrick Venture2018-09-071-38/+39
| | | | | Change-Id: I7c2a527b4751a560703a61fcbe9638b150546af5 Signed-off-by: Patrick Venture <venture@google.com>
* Use s.c_str() in log messagesJoseph Reynolds2018-05-311-2/+2
| | | | | | | | | | Fixes issues with data passed to phosphor::logging::log(entry()). This is part of a series of commits that resolves openbmc 2905. Tested: static_assert only Change-Id: I9fac771f54e4acbec97ce1360c106b6e3eb4fe9d Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>
* Inventory:- making changes in the mako and the C++ structureRatan Gupta2018-02-121-3/+3
| | | | | | | | | As fru yaml would be having extra properties like entityID,entityInstance so changes were needed to make the change in the corresponding c++ structure. Change-Id: I314d1556cf07a3e212996615c1cd2f28fb6d9bba Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Update Journal Variable NamesGunnar Mills2017-10-191-2/+2
| | | | | | | | | Journal entry variable names should be uppercase. https://www.freedesktop.org/software/systemd/man/sd_journal_print.html Also, fixed indentation. Change-Id: I2c838332ab7811ccc9a2c99f5b1f558c48f25f76 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Refactor reading and parsing of inventory dataMarri Devender Rao2017-09-081-24/+24
| | | | | | | | Refactored to use 'GetAll' dbus method call over multiple 'Get' dbus method calls to read the properties of a inventory object. Change-Id: I0ddc2150830961666fafa661cf29042f66137977 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* cater for property change signal to invalidate fru dataMarri Devender Rao2017-07-261-1/+52
| | | | | | | Resolves openbmc/openbmc#1560 Change-Id: I90897959dab76181a6006c372c4b60cc1bdd0c0c Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* read data for the specified FRU id from inventoryMarri Devender Rao2017-07-251-0/+118
Change-Id: I5255541719edad6453cd3163d9ad428548f1a2c7 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
OpenPOWER on IntegriCloud