CfgMgr::RevertSnapshot
Description
Restores a snapshot file by name.
Prototype
uint32_t CfgMgr::RevertSnapshot(const std::string &snapshotName = "", const bool isSync = true)
Function Security Level
ASIL-D
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
snapshotName |
Input |
Snapshot file name. |
isSync |
Input |
Whether to write persistent files synchronously. The default value is true. |
Returns
The return value is of the uint32_t type. If the operation is successful, CFGMGR_SUCCESS is returned. If the operation fails, an error code is returned.
Usage
After SELinux permission control is enabled, non-privileged processes can be called only after the read and write permissions on dp:/res/cfgmgr/mgmt are configured.
Precautions
- Restore snapshots based on names created by CfgMgr::CreateSnapshot.
- Snapshot restoration is performed on persistent parameters. Non-persistent parameters are not affected by restoration.
- If snapshot restoration fails, determine whether to report the fault or perform other operations.
- The interface may return a failure message for several reasons, including the absence of a file or permissions
Parent topic: Configuration Management