summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarri Devender Rao <devenrao@in.ibm.com>2017-11-08 03:38:27 -0600
committerAndrew Jeffery <andrew@aj.id.au>2017-11-17 06:37:07 +0000
commit08b0a89c56ada43f12003b5e99414c3719cd5e76 (patch)
treed981b638259db08b55ac9ccead685c5478cb6353
parent59ce099b7b59e86f2cc8ffedd3c97143dfccd33c (diff)
downloadphosphor-mboxd-08b0a89c56ada43f12003b5e99414c3719cd5e76.tar.gz
phosphor-mboxd-08b0a89c56ada43f12003b5e99414c3719cd5e76.zip
Fix up InternalFailure to include metadata
Scope is to add missing logs for InternalFailure errors Resolves openbmc/openbmc#2552, openbmc/openbmc#2568 Change-Id: Ic94b9d768e32b4d7be2b9b6746c1b675f15e3b1e Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
-rw-r--r--pnor_partition.cpp30
-rw-r--r--pnor_partition_table.cpp2
2 files changed, 32 insertions, 0 deletions
diff --git a/pnor_partition.cpp b/pnor_partition.cpp
index 1d5ca12..52a1275 100644
--- a/pnor_partition.cpp
+++ b/pnor_partition.cpp
@@ -64,6 +64,9 @@ std::string Request::getPartitionFilePath(struct mbox_context* context,
if (!partition)
{
MSG_ERR("Couldn't get the partition info for offset[0x%.8x]",offset);
+ log<level::ERR>("Request::getPartitionFilePath error in call to "
+ "vpnor_get_partition",
+ entry("OFFSET=%d", offset));
elog<InternalFailure>();
}
@@ -107,6 +110,11 @@ const pnor_partition* RORequest::getPartitionInfo(struct mbox_context* context,
// not interested in any other error except FILE_NOT_FOUND
if (rc != ReturnCode::FILE_NOT_FOUND)
{
+ log<level::ERR>("RORequest::getPartitionInfo error in opening "
+ "partition file",
+ entry("RC=%d", rc),
+ entry("FILE_NAME=%s", path.c_str()),
+ entry("OFFSET=%d", offset));
elog<InternalFailure>();
}
@@ -114,6 +122,11 @@ const pnor_partition* RORequest::getPartitionInfo(struct mbox_context* context,
if (partition->data.user.data[1] & PARTITION_READONLY)
{
MSG_ERR("Can't open the partition file");
+ log<level::ERR>("RORequest::getPartitionInfo error offset is "
+ "in read only partition",
+ entry("FILE_NAME=%s", path.c_str()),
+ entry("OFFSET=%d", offset),
+ entry("USER_DATA=%s", partition->data.user.data[1]));
elog<InternalFailure>();
}
@@ -126,6 +139,10 @@ const pnor_partition* RORequest::getPartitionInfo(struct mbox_context* context,
rc = Request::open(partitionFilePath, O_RDONLY);
if (rc != ReturnCode::SUCCESS)
{
+ log<level::ERR>("RORequest::getPartitionInfo error in opening "
+ "partition file from read only location",
+ entry("RC=%d", rc),
+ entry("FILE_NAME=%s", partitionFilePath.c_str()));
elog<InternalFailure>();
}
@@ -146,6 +163,11 @@ const pnor_partition* RWRequest::getPartitionInfo(struct mbox_context* context,
// not interested in any other error except FILE_NOT_FOUND
if (rc != ReturnCode::FILE_NOT_FOUND)
{
+ log<level::ERR>("RWRequest::getPartitionInfo error in opening "
+ "partition file",
+ entry("RC=%d", rc),
+ entry("FILE_NAME=%s", path.c_str()),
+ entry("OFFSET=%d", offset));
elog<InternalFailure>();
}
@@ -158,6 +180,10 @@ const pnor_partition* RWRequest::getPartitionInfo(struct mbox_context* context,
if (!fs::exists(fromPath))
{
MSG_ERR("Couldn't find the file[%s]",fromPath.c_str());
+ log<level::ERR>("RWRequest::getPartitionInfo error in opening "
+ "partition file from read only location",
+ entry("FILE_NAME=%s", fromPath.c_str()),
+ entry("OFFSET=%d", offset));
elog<InternalFailure>();
}
//copy the file from ro to respective partition
@@ -183,6 +209,10 @@ const pnor_partition* RWRequest::getPartitionInfo(struct mbox_context* context,
if (rc != ReturnCode::SUCCESS)
{
+ log<level::ERR>("RWRequest::getPartitionInfo error in opening "
+ "partition file from read write location",
+ entry("RC=%d", rc),
+ entry("FILE_NAME=%s", toPath.c_str()));
elog<InternalFailure>();
}
diff --git a/pnor_partition_table.cpp b/pnor_partition_table.cpp
index aa68750..3e3f1d1 100644
--- a/pnor_partition_table.cpp
+++ b/pnor_partition_table.cpp
@@ -238,6 +238,8 @@ const pnor_partition& Table::partition(const std::string& name) const
}
MSG_ERR("Partition %s not found", name.c_str());
+ log<level::ERR>("Table::partition partition not found ",
+ entry("PARTITION_NAME=%s", name.c_str()));
elog<InternalFailure>();
static pnor_partition p{};
return p;
OpenPOWER on IntegriCloud