Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable PEL for Bios Handler Class #560

Open
wants to merge 1 commit into
base: 1110
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 36 additions & 17 deletions vpd-manager/src/bios_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "bios_handler.hpp"

#include "constants.hpp"
#include "event_logger.hpp"
#include "logger.hpp"

#include <sdbusplus/bus/match.hpp>
Expand Down Expand Up @@ -145,8 +146,11 @@ void IbmBiosHandler::biosAttributesCallback(sdbusplus::message_t& i_msg)
}
else
{
// TODO: log a predicitive PEL.
logging::logMessage("Invalid typre received from BIOS table.");
EventLogger::createSyncPel(
types::ErrorType::DbusFailure, types::SeverityType::Warning,
__FILE__, __FUNCTION__, 0,
"Invalid type received from BIOS table.", std::nullopt,
std::nullopt, std::nullopt, std::nullopt);
break;
}
}
Expand Down Expand Up @@ -299,10 +303,12 @@ void IbmBiosHandler::saveFcoToBios(const types::BinaryVector& i_fcoVal)
}
catch (const std::exception& l_ex)
{
// TODO: Should we log informational PEL here as well?
logging::logMessage(
EventLogger::createSyncPel(
types::ErrorType::DbusFailure, types::SeverityType::Informational,
__FILE__, __FUNCTION__, 0,
"DBus call to update FCO value in pending attribute failed. " +
std::string(l_ex.what()));
std::string(l_ex.what()),
std::nullopt, std::nullopt, std::nullopt, std::nullopt);
}
}

Expand Down Expand Up @@ -346,9 +352,11 @@ void IbmBiosHandler::saveAmmToVpd(const std::string& i_memoryMirrorMode)
}
else
{
// TODO: Add PEL
logging::logMessage(
"Invalid type read for memory mirror mode value from DBus. Skip writing to VPD");
EventLogger::createSyncPel(
types::ErrorType::DbusFailure, types::SeverityType::Informational,
__FILE__, __FUNCTION__, 0,
"Invalid type read for memory mirror mode value from DBus. Skip writing to VPD",
std::nullopt, std::nullopt, std::nullopt, std::nullopt);
}
}

Expand Down Expand Up @@ -379,10 +387,12 @@ void IbmBiosHandler::saveAmmToBios(const std::string& i_ammVal)
}
catch (const std::exception& l_ex)
{
// TODO: Should we log informational PEL here as well?
logging::logMessage(
EventLogger::createSyncPel(
types::ErrorType::DbusFailure, types::SeverityType::Informational,
__FILE__, __FUNCTION__, 0,
"DBus call to update AMM value in pending attribute failed. " +
std::string(l_ex.what()));
std::string(l_ex.what()),
std::nullopt, std::nullopt, std::nullopt, std::nullopt);
}
}

Expand Down Expand Up @@ -514,9 +524,12 @@ void IbmBiosHandler::saveCreateDefaultLparToBios(
}
catch (const std::exception& l_ex)
{
logging::logMessage(
EventLogger::createSyncPel(
types::ErrorType::DbusFailure, types::SeverityType::Informational,
__FILE__, __FUNCTION__, 0,
"DBus call to update lpar value in pending attribute failed. " +
std::string(l_ex.what()));
std::string(l_ex.what()),
std::nullopt, std::nullopt, std::nullopt, std::nullopt);
}

return;
Expand Down Expand Up @@ -630,9 +643,12 @@ void IbmBiosHandler::saveClearNvramToBios(const std::string& i_clearNvramVal)
}
catch (const std::exception& l_ex)
{
logging::logMessage(
EventLogger::createSyncPel(
types::ErrorType::DbusFailure, types::SeverityType::Informational,
__FILE__, __FUNCTION__, 0,
"DBus call to update NVRAM value in pending attribute failed. " +
std::string(l_ex.what()));
std::string(l_ex.what()),
std::nullopt, std::nullopt, std::nullopt, std::nullopt);
}
}

Expand Down Expand Up @@ -741,9 +757,12 @@ void IbmBiosHandler::saveKeepAndClearToBios(
}
catch (const std::exception& l_ex)
{
logging::logMessage(
EventLogger::createSyncPel(
types::ErrorType::DbusFailure, types::SeverityType::Informational,
__FILE__, __FUNCTION__, 0,
"DBus call to update keep and clear value in pending attribute failed. " +
std::string(l_ex.what()));
std::string(l_ex.what()),
std::nullopt, std::nullopt, std::nullopt, std::nullopt);
}
}

Expand Down