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

How to persist the data to files and restore them when VM reboot? #52

Closed
UNKJay opened this issue Jul 10, 2021 · 2 comments
Closed

How to persist the data to files and restore them when VM reboot? #52

UNKJay opened this issue Jul 10, 2021 · 2 comments

Comments

@UNKJay
Copy link

UNKJay commented Jul 10, 2021

Hi maintainer
I want to persist the data to files and restore them when VM reboot, how can I do that? Do you have some ideas or guides for me?
Thank you so much.

@huaicheng
Copy link
Contributor

Good question! Persisting the data to files should be straightforward to do, consider following the following tips:

  • Ultimately, what needs to be done is writing the FEMU backend DRAM buffer (SsdDramBackend->logical_space) to a file.
  • You might also want to persist the FTL status (e.g. mapping table and metadata to record the page status, etc.) if you are using the Blackbox mode, or the OOB buffers for OCSSD mode
  • When to trigger the data persistence operations? Better do it at a place right before the QEMU main() loop exits.
  • When to load your persisted data structures from files? At FEMU initialization phase, you can replace the logic to fill relevant data structures with data read from files, rather than defaulting to zeros.

@UNKJay
Copy link
Author

UNKJay commented Jul 12, 2021

Thank you!!! I'll have a try

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

No branches or pull requests

2 participants