diff options
author | Cheng C Yang <cheng.c.yang@intel.com> | 2019-06-20 04:59:31 +0300 |
---|---|---|
committer | Feist, James <james.feist@intel.com> | 2019-07-23 02:43:53 +0300 |
commit | d551357ffada4d093d6b9541b1187c10f38856db (patch) | |
tree | 6bcec4c86bfb03700ff4092abd5be3261aec124a /services | |
parent | 1cfdbe614f53ee0dc01a2a5e17ce1f873f1933bd (diff) | |
download | provingground-d551357ffada4d093d6b9541b1187c10f38856db.tar.xz |
Fix NO UUID issue in MDRV1
MDRV1 do not have UUID in smbios table, it will show "NO UUID" which will
bring a issue to redfish. Remove UUID and BIOS Version from MDRV1.
Tested:
After DC cycle the host, MDRV1 will not show UUID and BIOS Version property
anymore.
Change-Id: I6db48be6c0e0c7bbaf73a9be7a3ba2c93b7c9d75
Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
Diffstat (limited to 'services')
-rw-r--r-- | services/smbios/CMakeLists.txt | 3 | ||||
-rw-r--r-- | services/smbios/include/manager.hpp | 2 | ||||
-rw-r--r-- | services/smbios/include/system.hpp | 69 | ||||
-rw-r--r-- | services/smbios/src/manager.cpp | 1 | ||||
-rw-r--r-- | services/smbios/src/system.cpp | 49 |
5 files changed, 1 insertions, 123 deletions
diff --git a/services/smbios/CMakeLists.txt b/services/smbios/CMakeLists.txt index e641809..767aac5 100644 --- a/services/smbios/CMakeLists.txt +++ b/services/smbios/CMakeLists.txt @@ -33,8 +33,7 @@ include_directories (${DBUSINTERFACE_INCLUDE_DIRS}) link_directories (${DBUSINTERFACE_LIBRARY_DIRS}) set (SRC_FILES src/manager.cpp src/smbios-main.cpp src/timer.cpp src/cpu.cpp - src/dimm.cpp src/system.cpp ${DBUS_OBJECT_NAME}/server.cpp - ${DBUS_OBJECT_NAME}/error.cpp) + src/dimm.cpp ${DBUS_OBJECT_NAME}/server.cpp ${DBUS_OBJECT_NAME}/error.cpp) include_directories (${CMAKE_CURRENT_BINARY_DIR}) diff --git a/services/smbios/include/manager.hpp b/services/smbios/include/manager.hpp index 7f2a591..5ce4583 100644 --- a/services/smbios/include/manager.hpp +++ b/services/smbios/include/manager.hpp @@ -22,7 +22,6 @@ #include <phosphor-logging/elog-errors.hpp> #include "cpu.hpp" #include "dimm.hpp" -#include "system.hpp" #include <unistd.h> #include <sys/stat.h> #include <sys/types.h> @@ -132,7 +131,6 @@ class MDR_V1 : sdbusplus::xyz::openbmc_project::Smbios::server::MDR_V1 std::vector<std::unique_ptr<Dimm>> dimms; std::vector<std::unique_ptr<Cpu>> cpus; - std::unique_ptr<System> system; void systemInfoUpdate(void); diff --git a/services/smbios/include/system.hpp b/services/smbios/include/system.hpp deleted file mode 100644 index 4bc7a5a..0000000 --- a/services/smbios/include/system.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/* -// Copyright (c) 2018 Intel Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -*/ - -#include <xyz/openbmc_project/Common/UUID/server.hpp> -#include <xyz/openbmc_project/Inventory/Decorator/Revision/server.hpp> -#include "smbios.hpp" - -namespace phosphor -{ - -namespace smbios -{ - -class System : sdbusplus::server::object::object< - sdbusplus::xyz::openbmc_project::Common::server::UUID>, - sdbusplus::server::object::object< - sdbusplus::xyz::openbmc_project::Inventory::Decorator:: - server::Revision> -{ - public: - System() = delete; - ~System() = default; - System(const System &) = delete; - System &operator=(const System &) = delete; - System(System &&) = default; - System &operator=(System &&) = default; - - System(sdbusplus::bus::bus &bus, const std::string &objPath, - struct ManagedDataRegion *region) : - sdbusplus::server::object::object< - sdbusplus::xyz::openbmc_project::Common::server::UUID>( - bus, objPath.c_str()), - sdbusplus::server::object::object< - sdbusplus::xyz::openbmc_project::Inventory::Decorator::server:: - Revision>(bus, objPath.c_str()), - path(objPath), regionS(region) - { - std::string input = "0"; - uUID(input); - version("0.00"); - } - - std::string uUID(std::string value) override; - - std::string version(std::string value) override; - - private: - /** @brief Path of the group instance */ - std::string path; - - struct ManagedDataRegion *regionS; -}; - -} // namespace smbios - -} // namespace phosphor diff --git a/services/smbios/src/manager.cpp b/services/smbios/src/manager.cpp index 1efe87a..c3bdf4a 100644 --- a/services/smbios/src/manager.cpp +++ b/services/smbios/src/manager.cpp @@ -173,7 +173,6 @@ void MDR_V1::systemInfoUpdate() std::vector<std::unique_ptr<Dimm>>().swap(dimms); std::vector<std::unique_ptr<Cpu>>().swap(cpus); - system = std::make_unique<System>(bus, systemPath, ®ionS[0]); for (int index = 0; index < num; index++) { path = dimmPath + std::to_string(index); diff --git a/services/smbios/src/system.cpp b/services/smbios/src/system.cpp deleted file mode 100644 index ac21bca..0000000 --- a/services/smbios/src/system.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* -// Copyright (c) 2018 Intel Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -*/ - -#include "system.hpp" - -namespace phosphor -{ -namespace smbios -{ - -std::string System::uUID(std::string value) -{ - std::string result = "No UUID"; - - return sdbusplus::xyz::openbmc_project::Common::server::UUID::uUID(result); -} - -std::string System::version(std::string value) -{ - std::string result = "No BIOS Version"; - uint8_t *dataIn = regionS[0].regionData; - dataIn = smbiosTypePtr(dataIn, biosType); - if (dataIn != nullptr) - { - auto biosInfo = reinterpret_cast<struct BIOSInfo *>(dataIn); - uint8_t biosVerByte = biosInfo->biosVersion; - std::string tempS = seekString(dataIn, biosVerByte); - result = tempS; - } - - return sdbusplus::xyz::openbmc_project::Inventory::Decorator::server:: - Revision::version(result); -} - -} // namespace smbios -} // namespace phosphor |