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 write keyword in backup and restore #385

Merged

Conversation

branupama
Copy link

This commit adds the changes to enable write keyword’s value on hardware in the backup & restore functionality.

@branupama branupama marked this pull request as draft September 26, 2024 18:03
@branupama branupama marked this pull request as ready for review September 27, 2024 02:45
@@ -157,6 +157,17 @@ void BackupAndRestore::backupAndRestoreIpzVpd(types::IPZVpdMap& io_srcVpdMap,
return;
}

const std::string l_srcFruPath =
jsonUtility::getFruPathFromJson(m_sysCfgJsonObj, i_srcPath);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will be the flow if these APIs throws? Should caller handle those or this API should handle that and return to the caller or should the json utility handle that and return empty here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if backupAndRestoreIpzVpd is completed without exception, at the caller we declaring Backup&Restore is success and also returning the update src & dst vpd map.
Caller is caching the exceptions from backupAndRestore* API's.

I have created the issue (#381) to relook at exceptions handling in backup&restore API's.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, on the basis of the issue, I am marking this comment as closed.
Need to revisit to optimize the exception handling in this class.

/* To keep the data in sync between hardware and parsed map
updating the io_dstVpdMap. This should only be done if write
on hardware returns success.*/
std::shared_ptr<Parser> l_vpdParser =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto can be used here as well. Also please use a blank line between blocks of code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

src/backup_restore.cpp Outdated Show resolved Hide resolved
@branupama branupama force-pushed the enable_write_in_BAR branch from 650492d to d56e0f7 Compare October 1, 2024 04:13
Copy link
Collaborator

@SunnySrivastava1984 SunnySrivastava1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exception handling needs to be revisited under Issue #381

@@ -157,6 +157,17 @@ void BackupAndRestore::backupAndRestoreIpzVpd(types::IPZVpdMap& io_srcVpdMap,
return;
}

const std::string l_srcFruPath =
jsonUtility::getFruPathFromJson(m_sysCfgJsonObj, i_srcPath);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, on the basis of the issue, I am marking this comment as closed.
Need to revisit to optimize the exception handling in this class.

src/backup_restore.cpp Show resolved Hide resolved
This commit adds the changes to enable write keyword’s value
on hardware in the backup & restore functionality.

Signed-off-by: Anupama B R <anupama.b.r1@ibm.com>
@SunnySrivastava1984 SunnySrivastava1984 merged commit cd2fd35 into ibm-openbmc:P11_Dev Oct 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants