Revert "Adding severity when reporting an error"

This reverts commit d28f08cf0238435ac92184fabaafd9c76bff62cf.

Reason for revert : Pel severity is completely openpower-specific , we should not polluting common code with IBM specific things, hence reverting this change for now.

Change-Id: If11721b1522097460ba07d51335b7ebbe821311a
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
diff --git a/common/types.hpp b/common/types.hpp
index 6f100c5..0c7514c 100644
--- a/common/types.hpp
+++ b/common/types.hpp
@@ -20,18 +20,6 @@
 using Response = std::vector<uint8_t>;
 using Command = uint8_t;
 
-enum PelSeverity
-{
-    Notice,
-    Informational,
-    Debug,
-    Warning,
-    Critical,
-    Emergency,
-    Alert,
-    Error
-};
-
 namespace dbus
 {
 
diff --git a/common/utils.cpp b/common/utils.cpp
index eee9f43..3a19e8b 100644
--- a/common/utils.cpp
+++ b/common/utils.cpp
@@ -448,7 +448,7 @@
     return response;
 }
 
-void reportError(const char* errorMsg, const Severity& sev)
+void reportError(const char* errorMsg)
 {
     auto& bus = pldm::utils::DBusHandler::getBus();
 
@@ -457,19 +457,15 @@
         using LoggingCreate =
             sdbusplus::client::xyz::openbmc_project::logging::Create<>;
 
-        std::string severity = "xyz.openbmc_project.Logging.Entry.Level.Error";
-
         using namespace sdbusplus::xyz::openbmc_project::Logging::server;
+        auto severity =
+            sdbusplus::xyz::openbmc_project::Logging::server::convertForMessage(
+                sdbusplus::xyz::openbmc_project::Logging::server::Entry::Level::
+                    Error);
         auto method = bus.new_method_call(LoggingCreate::default_service,
                                           LoggingCreate::instance_path,
                                           LoggingCreate::interface, "Create");
 
-        auto itr = sevMap.find(sev);
-        if (itr != sevMap.end())
-        {
-            severity = itr->second;
-        }
-
         std::map<std::string, std::string> addlData{};
         method.append(errorMsg, severity, addlData);
         bus.call_noreply(method, dbusTimeout);
diff --git a/common/utils.hpp b/common/utils.hpp
index 4463069..c2bdb0d 100644
--- a/common/utils.hpp
+++ b/common/utils.hpp
@@ -33,20 +33,6 @@
 
 namespace pldm
 {
-using Severity = pldm::PelSeverity;
-
-// mapping of severity enum to severity interface
-static std::unordered_map<Severity, std::string> sevMap = {
-    {Severity::Informational,
-     "xyz.openbmc_project.Logging.Entry.Level.Informational"},
-    {Severity::Debug, "xyz.openbmc_project.Logging.Entry.Level.Debug"},
-    {Severity::Notice, "xyz.openbmc_project.Logging.Entry.Level.Notice"},
-    {Severity::Warning, "xyz.openbmc_project.Logging.Entry.Level.Warning"},
-    {Severity::Critical, "xyz.openbmc_project.Logging.Entry.Level.Critical"},
-    {Severity::Emergency, "xyz.openbmc_project.Logging.Entry.Level.Emergency"},
-    {Severity::Error, "xyz.openbmc_project.Logging.Entry.Level.Error"},
-    {Severity::Alert, "xyz.openbmc_project.Logging.Entry.Level.Alert"}};
-
 namespace utils
 {
 namespace fs = std::filesystem;
@@ -154,11 +140,8 @@
 /**
  *  @brief creates an error log
  *  @param[in] errorMsg - the error message
- *  @param[in] sev - severity of the log
- *
  */
-void reportError(const char* errorMsg,
-                 const PelSeverity& sev = pldm::PelSeverity::Error);
+void reportError(const char* errorMsg);
 
 /** @brief Convert any Decimal number to BCD
  *
diff --git a/host-bmc/dbus_to_host_effecters.cpp b/host-bmc/dbus_to_host_effecters.cpp
index 21e893d..d5aeb58 100644
--- a/host-bmc/dbus_to_host_effecters.cpp
+++ b/host-bmc/dbus_to_host_effecters.cpp
@@ -289,14 +289,14 @@
             error("Failed to decode setStateEffecterStates response, rc {RC}",
                   "RC", rc);
             pldm::utils::reportError(
-                "xyz.openbmc_project.PLDM.Error.SetHostEffecterFailed");
+                "xyz.openbmc_project.bmc.pldm.SetHostEffecterFailed");
         }
         if (completionCode)
         {
             error("Failed to set a Host effecter, cc = {CC}", "CC",
                   static_cast<unsigned>(completionCode));
             pldm::utils::reportError(
-                "xyz.openbmc_project.PLDM.Error.SetHostEffecterFailed");
+                "xyz.openbmc_project.bmc.pldm.SetHostEffecterFailed");
         }
     };
 
diff --git a/host-bmc/host_pdr_handler.cpp b/host-bmc/host_pdr_handler.cpp
index 0d85d2b..72f2478 100644
--- a/host-bmc/host_pdr_handler.cpp
+++ b/host-bmc/host_pdr_handler.cpp
@@ -773,7 +773,7 @@
         {
             error("Failed to get State sensor PDR");
             pldm::utils::reportError(
-                "xyz.openbmc_project.PLDM.Error.SetHostSensorState.GetStateSensorPDRFail");
+                "xyz.openbmc_project.bmc.pldm.InternalFailure");
             return;
         }
 
@@ -807,7 +807,7 @@
                         "Failed to encode_get_state_sensor_readings_req, rc = {RC}",
                         "RC", rc);
                     pldm::utils::reportError(
-                        "xyz.openbmc_project.PLDM.Error.SetHostSensorState.EncodeStateSensorFail");
+                        "xyz.openbmc_project.bmc.pldm.InternalFailure");
                     return;
                 }
 
@@ -834,6 +834,8 @@
                             "Failed to decode_get_state_sensor_readings_resp, rc = {RC} cc = {CC}",
                             "RC", rc, "CC",
                             static_cast<unsigned>(completionCode));
+                        pldm::utils::reportError(
+                            "xyz.openbmc_project.bmc.pldm.InternalFailure");
                     }
 
                     uint8_t eventState;
diff --git a/libpldmresponder/platform.cpp b/libpldmresponder/platform.cpp
index e0870b2..6c77159 100644
--- a/libpldmresponder/platform.cpp
+++ b/libpldmresponder/platform.cpp
@@ -156,6 +156,7 @@
         }
     }
 }
+
 Response Handler::getPDR(const pldm_msg* request, size_t payloadLength)
 {
     if (hostPDRHandler)
@@ -998,7 +999,7 @@
                 "Failed to decode setEventReceiver command response, rc = {RC}, cc = {CC}",
                 "RC", rc, "CC", (unsigned)completionCode);
             pldm::utils::reportError(
-                "xyz.openbmc_project.PLDM.Error.InternalFailure");
+                "xyz.openbmc_project.bmc.pldm.InternalFailure");
         }
     };
     rc = handler->registerRequest(
diff --git a/oem/ibm/libpldmresponder/file_io_type_dump.cpp b/oem/ibm/libpldmresponder/file_io_type_dump.cpp
index f3394a3..83343b7 100644
--- a/oem/ibm/libpldmresponder/file_io_type_dump.cpp
+++ b/oem/ibm/libpldmresponder/file_io_type_dump.cpp
@@ -220,8 +220,7 @@
         {
             error("Failue in resource dump file ack");
             pldm::utils::reportError(
-                "xyz.openbmc_project.PLDM.Error.fileAck.ResourceDumpFileAckFail",
-                pldm::PelSeverity::Informational);
+                "xyz.openbmc_project.bmc.pldm.InternalFailure");
 
             PropertyValue value{
                 "xyz.openbmc_project.Common.Progress.OperationStatus.Failed"};
@@ -271,7 +270,7 @@
                     "fileAck: Failed to make a d-bus call to DUMP manager to reset source dump id of {FILE_PATH}, with ERROR={ERR_EXCEP}",
                     "FILE_PATH", path.c_str(), "ERR_EXCEP", e.what());
                 pldm::utils::reportError(
-                    "xyz.openbmc_project.PLDM.Error.fileAck.SourceDumpIdResetFail");
+                    "xyz.openbmc_project.bmc.PLDM.fileAck.SourceDumpIdResetFail");
                 return PLDM_ERROR;
             }
 
@@ -289,7 +288,7 @@
                     "fileAck: Failed to make a d-bus method to delete the dump entry {FILE_PATH}, with ERROR={ERR_EXCEP}",
                     "FILE_PATH", path.c_str(), "ERR_EXCEP", e.what());
                 pldm::utils::reportError(
-                    "xyz.openbmc_project.PLDM.Error.fileAck.DumpEntryDeleteFail");
+                    "xyz.openbmc_project.bmc.PLDM.fileAck.DumpEntryDeleteFail");
                 return PLDM_ERROR;
             }
             return PLDM_SUCCESS;
diff --git a/oem/ibm/requester/dbus_to_file_handler.cpp b/oem/ibm/requester/dbus_to_file_handler.cpp
index 35a4d9c..7f15103 100644
--- a/oem/ibm/requester/dbus_to_file_handler.cpp
+++ b/oem/ibm/requester/dbus_to_file_handler.cpp
@@ -38,7 +38,7 @@
         error(
             "Failed to send resource dump parameters as instance ID DB is not set");
         pldm::utils::reportError(
-            "xyz.openbmc_project.PLDM.Error.sendNewFileAvailableCmd.SendDumpParametersFail");
+            "xyz.openbmc_project.bmc.pldm.InternalFailure");
         return;
     }
     auto instanceId = instanceIdDb->next(mctp_eid);
@@ -88,9 +88,7 @@
 
 void DbusToFileHandler::reportResourceDumpFailure()
 {
-    pldm::utils::reportError(
-        "xyz.openbmc_project.PLDM.Error.ReportResourceDumpFail",
-        pldm::PelSeverity::Warning);
+    pldm::utils::reportError("xyz.openbmc_project.bmc.pldm.InternalFailure");
 
     PropertyValue value{resDumpStatus};
     DBusMapping dbusMapping{resDumpCurrentObjPath, resDumpProgressIntf,
@@ -249,7 +247,7 @@
     {
         error("Failed to send csr to host.");
         pldm::utils::reportError(
-            "xyz.openbmc_project.PLDM.Error.SendFileToHostFail");
+            "xyz.openbmc_project.bmc.pldm.InternalFailure");
         return;
     }
     auto instanceId = instanceIdDb->next(mctp_eid);
@@ -281,7 +279,7 @@
                 "Failed to decode_new_file_resp for vmi, or Host returned error for new_file_available rc = {RC}, cc = {CC}",
                 "RC", rc, "CC", static_cast<unsigned>(completionCode));
             pldm::utils::reportError(
-                "xyz.openbmc_project.PLDM.Error.DecodeNewFileResponseFail");
+                "xyz.openbmc_project.bmc.pldm.InternalFailure");
         }
     };
     rc = handler->registerRequest(
@@ -291,7 +289,7 @@
     {
         error("Failed to send NewFileAvailable Request to Host for vmi");
         pldm::utils::reportError(
-            "xyz.openbmc_project.PLDM.Error.NewFileAvailableRequestFail");
+            "xyz.openbmc_project.bmc.pldm.InternalFailure");
     }
 }
 
diff --git a/softoff/main.cpp b/softoff/main.cpp
index 64bf47e..cfbbcd2 100644
--- a/softoff/main.cpp
+++ b/softoff/main.cpp
@@ -48,7 +48,7 @@
     if (softPower.isTimerExpired() && softPower.isReceiveResponse())
     {
         pldm::utils::reportError(
-            "xyz.openbmc_project.PLDM.Error.SoftPowerOff.HostSoftOffTimeOut");
+            "pldm soft off: Waiting for the host soft off timeout");
         error(
             "PLDM host soft off: ERROR! Wait for the host soft off timeout. Exit the pldm-softpoweroff");
         return -1;