I managed to set up a way to let QEMU know that I only want to restore dirty pages from the snapshot.
And I can verify that it works.
I looked quite a bit into migration/ram.c and found that I can copy and modify ram_find_and_save_block for my use case.
If my understanding is correct, I need to call find_dirty_pages to identify dirty pages and then store the results from the page search status variable.
Then I need to iteratively clear the dirty bits using the migration_bitmap_clear_dirty in a manner that is similar to save_host_page.
And these two steps have to be performed iteratively until the find_dirty_pages sets the flag to break this loop.
Is my understanding correct?
Thank you.
Jay