smbiosmdrv2handler.cpp (5ee2d8d03e5a6a936dda7b27c6ce82a8eefeb417) | smbiosmdrv2handler.cpp (fcd2d3a943c4fb518d399d8a0addd1cc661e5628) |
---|---|
1/* 2// Copyright (c) 2018 Intel Corporation 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 --- 8 unchanged lines hidden (view full) --- 17#include <errno.h> 18#include <fcntl.h> 19#include <limits.h> 20#include <sys/stat.h> 21#include <sys/types.h> 22#include <unistd.h> 23 24#include <commandutils.hpp> | 1/* 2// Copyright (c) 2018 Intel Corporation 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 --- 8 unchanged lines hidden (view full) --- 17#include <errno.h> 18#include <fcntl.h> 19#include <limits.h> 20#include <sys/stat.h> 21#include <sys/types.h> 22#include <unistd.h> 23 24#include <commandutils.hpp> |
25#include <cstdint> 26#include <fstream> | |
27#include <ipmid/api.hpp> 28#include <ipmid/utils.hpp> 29#include <oemcommands.hpp> 30#include <phosphor-logging/log.hpp> 31#include <sdbusplus/message/types.hpp> 32#include <smbiosmdrv2handler.hpp> | 25#include <ipmid/api.hpp> 26#include <ipmid/utils.hpp> 27#include <oemcommands.hpp> 28#include <phosphor-logging/log.hpp> 29#include <sdbusplus/message/types.hpp> 30#include <smbiosmdrv2handler.hpp> |
31#include <xyz/openbmc_project/Common/error.hpp> 32 33#include <cstdint> 34#include <fstream> |
|
33#include <string> 34#include <vector> | 35#include <string> 36#include <vector> |
35#include <xyz/openbmc_project/Common/error.hpp> | |
36 37std::unique_ptr<MDRV2> mdrv2 = nullptr; 38static constexpr const uint8_t ccOemInvalidChecksum = 0x85; 39static constexpr size_t dataInfoSize = 16; 40static constexpr const uint8_t ccStorageLeak = 0xC4; 41 42static void register_netfn_smbiosmdrv2_functions() __attribute__((constructor)); 43 | 37 38std::unique_ptr<MDRV2> mdrv2 = nullptr; 39static constexpr const uint8_t ccOemInvalidChecksum = 0x85; 40static constexpr size_t dataInfoSize = 16; 41static constexpr const uint8_t ccStorageLeak = 0xC4; 42 43static void register_netfn_smbiosmdrv2_functions() __attribute__((constructor)); 44 |
44int MDRV2::agentLookup(const uint16_t &agentId) | 45int MDRV2::agentLookup(const uint16_t& agentId) |
45{ 46 int agentIndex = -1; 47 48 if (lastAgentId == agentId) 49 { 50 return lastAgentIndex; 51 } 52 53 if (agentId == smbiosAgentId) 54 { 55 return firstAgentIndex; 56 } 57 58 return agentIndex; 59} 60 | 46{ 47 int agentIndex = -1; 48 49 if (lastAgentId == agentId) 50 { 51 return lastAgentIndex; 52 } 53 54 if (agentId == smbiosAgentId) 55 { 56 return firstAgentIndex; 57 } 58 59 return agentIndex; 60} 61 |
61int MDRV2::sdplusMdrv2GetProperty(const std::string &name, 62 std::variant<uint8_t> &value, 63 const std::string &service) | 62int MDRV2::sdplusMdrv2GetProperty(const std::string& name, 63 std::variant<uint8_t>& value, 64 const std::string& service) |
64{ 65 std::shared_ptr<sdbusplus::asio::connection> bus = getSdBus(); 66 sdbusplus::message::message method = 67 bus->new_method_call(service.c_str(), mdrv2Path, dbusProperties, "Get"); 68 method.append(mdrv2Interface, name); 69 70 sdbusplus::message::message reply = bus->call(method); 71 72 try 73 { 74 sdbusplus::message::message reply = bus->call(method); 75 reply.read(value); 76 } | 65{ 66 std::shared_ptr<sdbusplus::asio::connection> bus = getSdBus(); 67 sdbusplus::message::message method = 68 bus->new_method_call(service.c_str(), mdrv2Path, dbusProperties, "Get"); 69 method.append(mdrv2Interface, name); 70 71 sdbusplus::message::message reply = bus->call(method); 72 73 try 74 { 75 sdbusplus::message::message reply = bus->call(method); 76 reply.read(value); 77 } |
77 catch (sdbusplus::exception_t &e) | 78 catch (sdbusplus::exception_t& e) |
78 { 79 phosphor::logging::log<phosphor::logging::level::ERR>( 80 "Error get property, sdbusplus call failed", 81 phosphor::logging::entry("ERROR=%s", e.what())); 82 return -1; 83 } 84 85 return 0; 86} 87 88int MDRV2::syncDirCommonData(uint8_t idIndex, uint32_t size, | 79 { 80 phosphor::logging::log<phosphor::logging::level::ERR>( 81 "Error get property, sdbusplus call failed", 82 phosphor::logging::entry("ERROR=%s", e.what())); 83 return -1; 84 } 85 86 return 0; 87} 88 89int MDRV2::syncDirCommonData(uint8_t idIndex, uint32_t size, |
89 const std::string &service) | 90 const std::string& service) |
90{ 91 std::vector<uint32_t> commonData; 92 std::shared_ptr<sdbusplus::asio::connection> bus = getSdBus(); 93 sdbusplus::message::message method = 94 bus->new_method_call(service.c_str(), mdrv2Path, mdrv2Interface, 95 "SynchronizeDirectoryCommonData"); 96 method.append(idIndex, size); 97 98 try 99 { 100 sdbusplus::message::message reply = bus->call(method); 101 reply.read(commonData); 102 } | 91{ 92 std::vector<uint32_t> commonData; 93 std::shared_ptr<sdbusplus::asio::connection> bus = getSdBus(); 94 sdbusplus::message::message method = 95 bus->new_method_call(service.c_str(), mdrv2Path, mdrv2Interface, 96 "SynchronizeDirectoryCommonData"); 97 method.append(idIndex, size); 98 99 try 100 { 101 sdbusplus::message::message reply = bus->call(method); 102 reply.read(commonData); 103 } |
103 catch (sdbusplus::exception_t &e) | 104 catch (sdbusplus::exception_t& e) |
104 { 105 phosphor::logging::log<phosphor::logging::level::ERR>( 106 "Error sync dir common data with service", 107 phosphor::logging::entry("ERROR=%s", e.what())); 108 return -1; 109 } 110 111 if (commonData.size() < syncDirCommonSize) --- 4 unchanged lines hidden (view full) --- 116 } 117 smbiosDir.dir[idIndex].common.dataSetSize = commonData.at(0); 118 smbiosDir.dir[idIndex].common.dataVersion = commonData.at(1); 119 smbiosDir.dir[idIndex].common.timestamp = commonData.at(2); 120 121 return 0; 122} 123 | 105 { 106 phosphor::logging::log<phosphor::logging::level::ERR>( 107 "Error sync dir common data with service", 108 phosphor::logging::entry("ERROR=%s", e.what())); 109 return -1; 110 } 111 112 if (commonData.size() < syncDirCommonSize) --- 4 unchanged lines hidden (view full) --- 117 } 118 smbiosDir.dir[idIndex].common.dataSetSize = commonData.at(0); 119 smbiosDir.dir[idIndex].common.dataVersion = commonData.at(1); 120 smbiosDir.dir[idIndex].common.timestamp = commonData.at(2); 121 122 return 0; 123} 124 |
124int MDRV2::findDataId(const uint8_t *dataInfo, const size_t &len, 125 const std::string &service) | 125int MDRV2::findDataId(const uint8_t* dataInfo, const size_t& len, 126 const std::string& service) |
126{ 127 int idIndex = -1; 128 129 if (dataInfo == nullptr) 130 { 131 phosphor::logging::log<phosphor::logging::level::ERR>( 132 "Error dataInfo, input is null point"); 133 return -1; --- 7 unchanged lines hidden (view full) --- 141 std::copy(dataInfo, dataInfo + len, info.data()); 142 method.append(info); 143 144 try 145 { 146 sdbusplus::message::message reply = bus->call(method); 147 reply.read(idIndex); 148 } | 127{ 128 int idIndex = -1; 129 130 if (dataInfo == nullptr) 131 { 132 phosphor::logging::log<phosphor::logging::level::ERR>( 133 "Error dataInfo, input is null point"); 134 return -1; --- 7 unchanged lines hidden (view full) --- 142 std::copy(dataInfo, dataInfo + len, info.data()); 143 method.append(info); 144 145 try 146 { 147 sdbusplus::message::message reply = bus->call(method); 148 reply.read(idIndex); 149 } |
149 catch (sdbusplus::exception_t &e) | 150 catch (sdbusplus::exception_t& e) |
150 { 151 phosphor::logging::log<phosphor::logging::level::ERR>( 152 "Error find id index", 153 phosphor::logging::entry("ERROR=%s", e.what()), 154 phosphor::logging::entry("SERVICE=%s", service.c_str()), 155 phosphor::logging::entry("PATH=%s", mdrv2Path)); 156 return -1; 157 } 158 159 return idIndex; 160} 161 | 151 { 152 phosphor::logging::log<phosphor::logging::level::ERR>( 153 "Error find id index", 154 phosphor::logging::entry("ERROR=%s", e.what()), 155 phosphor::logging::entry("SERVICE=%s", service.c_str()), 156 phosphor::logging::entry("PATH=%s", mdrv2Path)); 157 return -1; 158 } 159 160 return idIndex; 161} 162 |
162uint16_t MDRV2::getSessionHandle(Mdr2DirStruct *dir) | 163uint16_t MDRV2::getSessionHandle(Mdr2DirStruct* dir) |
163{ 164 if (dir == NULL) 165 { 166 phosphor::logging::log<phosphor::logging::level::ERR>( 167 "Empty dir point"); 168 return 0; 169 } 170 dir->sessionHandle++; 171 if (dir->sessionHandle == 0) 172 { 173 dir->sessionHandle = 1; 174 } 175 176 return dir->sessionHandle; 177} 178 | 164{ 165 if (dir == NULL) 166 { 167 phosphor::logging::log<phosphor::logging::level::ERR>( 168 "Empty dir point"); 169 return 0; 170 } 171 dir->sessionHandle++; 172 if (dir->sessionHandle == 0) 173 { 174 dir->sessionHandle = 1; 175 } 176 177 return dir->sessionHandle; 178} 179 |
179int MDRV2::findLockHandle(const uint16_t &lockHandle) | 180int MDRV2::findLockHandle(const uint16_t& lockHandle) |
180{ 181 int idIndex = -1; 182 183 for (int index = 0; index < smbiosDir.dirEntries; index++) 184 { 185 if (lockHandle == smbiosDir.dir[index].lockHandle) 186 { 187 return index; --- 12 unchanged lines hidden (view full) --- 200 if (smbiosDir.dir[index].stage == MDR2SMBIOSStatusEnum::mdr2Updating) 201 { 202 return true; 203 } 204 205 return false; 206} 207 | 181{ 182 int idIndex = -1; 183 184 for (int index = 0; index < smbiosDir.dirEntries; index++) 185 { 186 if (lockHandle == smbiosDir.dir[index].lockHandle) 187 { 188 return index; --- 12 unchanged lines hidden (view full) --- 201 if (smbiosDir.dir[index].stage == MDR2SMBIOSStatusEnum::mdr2Updating) 202 { 203 return true; 204 } 205 206 return false; 207} 208 |
208uint32_t MDRV2::calcChecksum32(uint8_t *buf, uint32_t len) | 209uint32_t MDRV2::calcChecksum32(uint8_t* buf, uint32_t len) |
209{ 210 uint32_t sum = 0; 211 212 if (buf == nullptr) 213 { 214 return invalidChecksum; 215 } 216 --- 97 unchanged lines hidden (view full) --- 314 method.append(dirIndex); 315 316 std::vector<uint8_t> dataOut; 317 try 318 { 319 sdbusplus::message::message reply = bus->call(method); 320 reply.read(dataOut); 321 } | 210{ 211 uint32_t sum = 0; 212 213 if (buf == nullptr) 214 { 215 return invalidChecksum; 216 } 217 --- 97 unchanged lines hidden (view full) --- 315 method.append(dirIndex); 316 317 std::vector<uint8_t> dataOut; 318 try 319 { 320 sdbusplus::message::message reply = bus->call(method); 321 reply.read(dataOut); 322 } |
322 catch (sdbusplus::exception_t &e) | 323 catch (sdbusplus::exception_t& e) |
323 { 324 phosphor::logging::log<phosphor::logging::level::ERR>( 325 "Error get dir", phosphor::logging::entry("ERROR=%s", e.what()), 326 phosphor::logging::entry("SERVICE=%s", service.c_str()), 327 phosphor::logging::entry("PATH=%s", mdrv2Path)); 328 return ipmi::responseResponseError(); 329 } 330 --- 52 unchanged lines hidden (view full) --- 383 dataInfo, size, dataSetSize, dataVersion, timestamp); 384 385 bool terminate = false; 386 try 387 { 388 sdbusplus::message::message reply = bus->call(method); 389 reply.read(terminate); 390 } | 324 { 325 phosphor::logging::log<phosphor::logging::level::ERR>( 326 "Error get dir", phosphor::logging::entry("ERROR=%s", e.what()), 327 phosphor::logging::entry("SERVICE=%s", service.c_str()), 328 phosphor::logging::entry("PATH=%s", mdrv2Path)); 329 return ipmi::responseResponseError(); 330 } 331 --- 52 unchanged lines hidden (view full) --- 384 dataInfo, size, dataSetSize, dataVersion, timestamp); 385 386 bool terminate = false; 387 try 388 { 389 sdbusplus::message::message reply = bus->call(method); 390 reply.read(terminate); 391 } |
391 catch (sdbusplus::exception_t &e) | 392 catch (sdbusplus::exception_t& e) |
392 { 393 phosphor::logging::log<phosphor::logging::level::ERR>( 394 "Error send dir", phosphor::logging::entry("ERROR=%s", e.what()), 395 phosphor::logging::entry("SERVICE=%s", service.c_str()), 396 phosphor::logging::entry("PATH=%s", mdrv2Path)); 397 return ipmi::responseResponseError(); 398 } 399 --- 49 unchanged lines hidden (view full) --- 449 method.append(idIndex); 450 451 std::vector<uint8_t> res; 452 try 453 { 454 sdbusplus::message::message reply = bus->call(method); 455 reply.read(res); 456 } | 393 { 394 phosphor::logging::log<phosphor::logging::level::ERR>( 395 "Error send dir", phosphor::logging::entry("ERROR=%s", e.what()), 396 phosphor::logging::entry("SERVICE=%s", service.c_str()), 397 phosphor::logging::entry("PATH=%s", mdrv2Path)); 398 return ipmi::responseResponseError(); 399 } 400 --- 49 unchanged lines hidden (view full) --- 450 method.append(idIndex); 451 452 std::vector<uint8_t> res; 453 try 454 { 455 sdbusplus::message::message reply = bus->call(method); 456 reply.read(res); 457 } |
457 catch (sdbusplus::exception_t &e) | 458 catch (sdbusplus::exception_t& e) |
458 { 459 phosphor::logging::log<phosphor::logging::level::ERR>( 460 "Error get data info", 461 phosphor::logging::entry("ERROR=%s", e.what()), 462 phosphor::logging::entry("SERVICE=%s", service.c_str()), 463 phosphor::logging::entry("PATH=%s", mdrv2Path)); 464 return ipmi::responseResponseError(); 465 } --- 36 unchanged lines hidden (view full) --- 502 service.c_str(), mdrv2Path, mdrv2Interface, "GetDataOffer"); 503 504 std::vector<uint8_t> dataOut; 505 try 506 { 507 sdbusplus::message::message reply = bus->call(method); 508 reply.read(dataOut); 509 } | 459 { 460 phosphor::logging::log<phosphor::logging::level::ERR>( 461 "Error get data info", 462 phosphor::logging::entry("ERROR=%s", e.what()), 463 phosphor::logging::entry("SERVICE=%s", service.c_str()), 464 phosphor::logging::entry("PATH=%s", mdrv2Path)); 465 return ipmi::responseResponseError(); 466 } --- 36 unchanged lines hidden (view full) --- 503 service.c_str(), mdrv2Path, mdrv2Interface, "GetDataOffer"); 504 505 std::vector<uint8_t> dataOut; 506 try 507 { 508 sdbusplus::message::message reply = bus->call(method); 509 reply.read(dataOut); 510 } |
510 catch (sdbusplus::exception_t &e) | 511 catch (sdbusplus::exception_t& e) |
511 { 512 phosphor::logging::log<phosphor::logging::level::ERR>( 513 "Error send data info offer", 514 phosphor::logging::entry("ERROR=%s", e.what()), 515 phosphor::logging::entry("SERVICE=%s", service.c_str()), 516 phosphor::logging::entry("PATH=%s", mdrv2Path)); 517 return ipmi::responseResponseError(); 518 } --- 64 unchanged lines hidden (view full) --- 583 timeStamp); 584 585 bool entryChanged = true; 586 try 587 { 588 sdbusplus::message::message reply = bus->call(method); 589 reply.read(entryChanged); 590 } | 512 { 513 phosphor::logging::log<phosphor::logging::level::ERR>( 514 "Error send data info offer", 515 phosphor::logging::entry("ERROR=%s", e.what()), 516 phosphor::logging::entry("SERVICE=%s", service.c_str()), 517 phosphor::logging::entry("PATH=%s", mdrv2Path)); 518 return ipmi::responseResponseError(); 519 } --- 64 unchanged lines hidden (view full) --- 584 timeStamp); 585 586 bool entryChanged = true; 587 try 588 { 589 sdbusplus::message::message reply = bus->call(method); 590 reply.read(entryChanged); 591 } |
591 catch (sdbusplus::exception_t &e) | 592 catch (sdbusplus::exception_t& e) |
592 { 593 phosphor::logging::log<phosphor::logging::level::ERR>( 594 "Error send data info", 595 phosphor::logging::entry("ERROR=%s", e.what()), 596 phosphor::logging::entry("SERVICE=%s", service.c_str()), 597 phosphor::logging::entry("PATH=%s", mdrv2Path)); 598 return ipmi::responseResponseError(); 599 } --- 155 unchanged lines hidden (view full) --- 755 if (reinterpret_cast<size_t>( 756 mdrv2->smbiosDir.dir[idIndex].dataStorage) > 757 UINT_MAX - xferOffset) 758 { 759 phosphor::logging::log<phosphor::logging::level::ERR>( 760 "Offset is out of range"); 761 return ipmi::responseParmOutOfRange(); 762 } | 593 { 594 phosphor::logging::log<phosphor::logging::level::ERR>( 595 "Error send data info", 596 phosphor::logging::entry("ERROR=%s", e.what()), 597 phosphor::logging::entry("SERVICE=%s", service.c_str()), 598 phosphor::logging::entry("PATH=%s", mdrv2Path)); 599 return ipmi::responseResponseError(); 600 } --- 155 unchanged lines hidden (view full) --- 756 if (reinterpret_cast<size_t>( 757 mdrv2->smbiosDir.dir[idIndex].dataStorage) > 758 UINT_MAX - xferOffset) 759 { 760 phosphor::logging::log<phosphor::logging::level::ERR>( 761 "Offset is out of range"); 762 return ipmi::responseParmOutOfRange(); 763 } |
763 uint8_t *destAddr = | 764 uint8_t* destAddr = |
764 mdrv2->smbiosDir.dir[idIndex].dataStorage + xferOffset; | 765 mdrv2->smbiosDir.dir[idIndex].dataStorage + xferOffset; |
765 uint8_t *sourceAddr = reinterpret_cast<uint8_t *>(mdrv2->area->vPtr); | 766 uint8_t* sourceAddr = reinterpret_cast<uint8_t*>(mdrv2->area->vPtr); |
766 uint32_t calcChecksum = mdrv2->calcChecksum32(sourceAddr, xferLength); 767 if (calcChecksum != checksum) 768 { 769 phosphor::logging::log<phosphor::logging::level::ERR>( 770 "Send data block Invalid checksum"); 771 return ipmi::response(ccOemInvalidChecksum); 772 } 773 else --- 12 unchanged lines hidden (view full) --- 786 phosphor::logging::log<phosphor::logging::level::ERR>( 787 "Send data block failed, other data is updating"); 788 return ipmi::responseDestinationUnavailable(); 789 } 790 791 return ipmi::responseSuccess(); 792} 793 | 767 uint32_t calcChecksum = mdrv2->calcChecksum32(sourceAddr, xferLength); 768 if (calcChecksum != checksum) 769 { 770 phosphor::logging::log<phosphor::logging::level::ERR>( 771 "Send data block Invalid checksum"); 772 return ipmi::response(ccOemInvalidChecksum); 773 } 774 else --- 12 unchanged lines hidden (view full) --- 787 phosphor::logging::log<phosphor::logging::level::ERR>( 788 "Send data block failed, other data is updating"); 789 return ipmi::responseDestinationUnavailable(); 790 } 791 792 return ipmi::responseSuccess(); 793} 794 |
794bool MDRV2::storeDatatoFlash(MDRSMBIOSHeader *mdrHdr, uint8_t *data) | 795bool MDRV2::storeDatatoFlash(MDRSMBIOSHeader* mdrHdr, uint8_t* data) |
795{ 796 std::ofstream smbiosFile(mdrType2File, 797 std::ios_base::binary | std::ios_base::trunc); 798 if (!smbiosFile.good()) 799 { 800 phosphor::logging::log<phosphor::logging::level::ERR>( 801 "Write data from flash error - Open MDRV2 table file failure"); 802 return false; 803 } 804 805 try 806 { | 796{ 797 std::ofstream smbiosFile(mdrType2File, 798 std::ios_base::binary | std::ios_base::trunc); 799 if (!smbiosFile.good()) 800 { 801 phosphor::logging::log<phosphor::logging::level::ERR>( 802 "Write data from flash error - Open MDRV2 table file failure"); 803 return false; 804 } 805 806 try 807 { |
807 smbiosFile.write(reinterpret_cast<char *>(mdrHdr), | 808 smbiosFile.write(reinterpret_cast<char*>(mdrHdr), |
808 sizeof(MDRSMBIOSHeader)); | 809 sizeof(MDRSMBIOSHeader)); |
809 smbiosFile.write(reinterpret_cast<char *>(data), mdrHdr->dataSize); | 810 smbiosFile.write(reinterpret_cast<char*>(data), mdrHdr->dataSize); |
810 } | 811 } |
811 catch (std::ofstream::failure &e) | 812 catch (std::ofstream::failure& e) |
812 { 813 phosphor::logging::log<phosphor::logging::level::ERR>( 814 "Write data from flash error - write data error", 815 phosphor::logging::entry("ERROR=%s", e.what())); 816 return false; 817 } 818 819 return true; --- 57 unchanged lines hidden (view full) --- 877 878 default: 879 break; 880 } 881 882 return ret; 883} 884 | 813 { 814 phosphor::logging::log<phosphor::logging::level::ERR>( 815 "Write data from flash error - write data error", 816 phosphor::logging::entry("ERROR=%s", e.what())); 817 return false; 818 } 819 820 return true; --- 57 unchanged lines hidden (view full) --- 878 879 default: 880 break; 881 } 882 883 return ret; 884} 885 |
885bool MDRV2::smbiosTryLock(uint8_t flag, uint8_t index, uint16_t *session, | 886bool MDRV2::smbiosTryLock(uint8_t flag, uint8_t index, uint16_t* session, |
886 uint16_t timeout) 887{ 888 bool ret = false; 889 uint32_t u32Status = 0; 890 891 if (timeout == 0) 892 { 893 timeout = defaultTimeout; --- 222 unchanged lines hidden (view full) --- 1116 1117 if (mdrv2->smbiosTryLock(1, idIndex, &session, timeout)) 1118 { 1119 try 1120 { 1121 mdrv2->area = 1122 std::make_unique<SharedMemoryArea>(xferAddress, xferLength); 1123 } | 887 uint16_t timeout) 888{ 889 bool ret = false; 890 uint32_t u32Status = 0; 891 892 if (timeout == 0) 893 { 894 timeout = defaultTimeout; --- 222 unchanged lines hidden (view full) --- 1117 1118 if (mdrv2->smbiosTryLock(1, idIndex, &session, timeout)) 1119 { 1120 try 1121 { 1122 mdrv2->area = 1123 std::make_unique<SharedMemoryArea>(xferAddress, xferLength); 1124 } |
1124 catch (const std::system_error &e) | 1125 catch (const std::system_error& e) |
1125 { 1126 mdrv2->smbiosUnlock(idIndex); 1127 phosphor::logging::log<phosphor::logging::level::ERR>( 1128 "Unable to access share memory", 1129 phosphor::logging::entry("ERROR=%s", e.what())); 1130 return ipmi::responseUnspecifiedError(); 1131 } 1132 mdrv2->smbiosDir.dir[idIndex].common.size = dataLength; --- 87 unchanged lines hidden (view full) --- 1220 sdbusplus::message::message method = bus->new_method_call( 1221 service.c_str(), mdrv2Path, mdrv2Interface, "AgentSynchronizeData"); 1222 1223 try 1224 { 1225 sdbusplus::message::message reply = bus->call(method); 1226 reply.read(status); 1227 } | 1126 { 1127 mdrv2->smbiosUnlock(idIndex); 1128 phosphor::logging::log<phosphor::logging::level::ERR>( 1129 "Unable to access share memory", 1130 phosphor::logging::entry("ERROR=%s", e.what())); 1131 return ipmi::responseUnspecifiedError(); 1132 } 1133 mdrv2->smbiosDir.dir[idIndex].common.size = dataLength; --- 87 unchanged lines hidden (view full) --- 1221 sdbusplus::message::message method = bus->new_method_call( 1222 service.c_str(), mdrv2Path, mdrv2Interface, "AgentSynchronizeData"); 1223 1224 try 1225 { 1226 sdbusplus::message::message reply = bus->call(method); 1227 reply.read(status); 1228 } |
1228 catch (sdbusplus::exception_t &e) | 1229 catch (sdbusplus::exception_t& e) |
1229 { 1230 phosphor::logging::log<phosphor::logging::level::ERR>( 1231 "Error Sync data with service", 1232 phosphor::logging::entry("ERROR=%s", e.what()), 1233 phosphor::logging::entry("SERVICE=%s", service.c_str()), 1234 phosphor::logging::entry("PATH=%s", mdrv2Path)); 1235 return ipmi::responseResponseError(); 1236 } --- 74 unchanged lines hidden --- | 1230 { 1231 phosphor::logging::log<phosphor::logging::level::ERR>( 1232 "Error Sync data with service", 1233 phosphor::logging::entry("ERROR=%s", e.what()), 1234 phosphor::logging::entry("SERVICE=%s", service.c_str()), 1235 phosphor::logging::entry("PATH=%s", mdrv2Path)); 1236 return ipmi::responseResponseError(); 1237 } --- 74 unchanged lines hidden --- |