This makes it very difficult to keep in sync with the existing files, and has caused several bugs because the path it uses is different than the existing bmcweb_persistent_data.json, and it's missing several error code checks.
The fields used there need to be merged into bmcweb_persistent_data, ideally in such a way that it is seamlessly migrated. off the top of my head, just putting the full file in a key under the existing file seems like it would be just fine, and would allow for a simple migration strategy.
If file exists, read file in, and inject it into the "Events" key in the existing json file. From there, the rest of the structures can use the existing bmcweb code for reading and writing persistent data.
Event manager persists its eventing in a separate file here: https://github.com/openbmc/bmcweb/blob/f23b729676559f539790580930b1ff3b0c05805b/redfish-core/include/event_service_manager.hpp#L637
This makes it very difficult to keep in sync with the existing files, and has caused several bugs because the path it uses is different than the existing bmcweb_persistent_data.json, and it's missing several error code checks.
The fields used there need to be merged into bmcweb_persistent_data, ideally in such a way that it is seamlessly migrated. off the top of my head, just putting the full file in a key under the existing file seems like it would be just fine, and would allow for a simple migration strategy.
If file exists, read file in, and inject it into the "Events" key in the existing json file. From there, the rest of the structures can use the existing bmcweb code for reading and writing persistent data.