AlgorithmDescription:
Set all the bits in to_send to 1;
For (;;)
{
ITER ++; send_this_iter = 0; skip_this_iter = 0;
While (n <p2m_size) // p2m_size indicates the number of pages in the physical memory of the I VM.
{
Call the xc_shadow_control () function to copy the dirty page bitmap to to_skip;
For (batch = 0; (batch <MAX-BATCH a size) & (n <p2m_size); N ++)
{
If (! Last_iter & test_bit (n, to_send) & test_bit (n, to_kip ))
Skip_this_iterl ++;
If (page n meets three conditions)
Place the page in the sending buffer pfn_type [batch;
Batch ++;
}
Map the memory page in the buffer to the corresponding memory;
Disconnects the pfing between PFN and MFN;
Transfer memory page;
}
If (last_iter) // loop exit
break;
If (the exit condition is met)
{
last_iter = 1;
suspends a VM;
}< br> call the xc_shadow_control () function () copy the dirty page bitmap to to_send;
}