Monday, December 3, 2018

QEMU migration

RAM migration is basically sending all pages in RAMblock structure's'.

http://blog.vmsplice.net/2016/01/qemu-internals-how-guest-physical-ram.html

ram_list global variable has all the RAMblocks.

Therefore, RAM migration is
1) iterating all RAMblocks
2) iterating all pages in a RAM block

ram_save_page() is the function that sends a page to the destination.
It only cares the source block and the offset within the block (i.e. nth page in the block) recorded in PageSearchStatus structure.

```
/* used by the search for pages to send */
struct PageSearchStatus {
    /* Current block being searched */
    RAMBlock    *block;
    /* Current page to search from */
    unsigned long page; /* The nth page in the block */
    /* Set once we wrap around */
    bool         complete_round;
};
```


No comments:

Post a Comment